Google Maps, My Maps, YouTube, Androidify, Slides, Music Updated–Here’s What’s New

In the last few weeks, Google has been … more

SuperSU BETA: Root Android Lollipop on Stock Kernel

Up until now, if you wanted to get root on Android 5.0, you needed to flash a modified … more

Android App Review: Get Amaze with Material Design – XDA TV

Material Design is all the buzz in the Android world right now. Android 5.0 … more

Small But Eternal: HTC Explorer Receives Unofficial CM12

When HTC officially announced the HTC Explorer, they most likely weren’t … more

Welcome to XDA

Search to go directly to your device's forum

Register an account

Unlock full posting privileges

Ask a question

No registration required
Post Reply

[Mod] [4.2.2] LED notifications with Stamina Mode enabled

OP mbc07

17th December 2013, 08:32 PM   |  #1  
mbc07's Avatar
OP Senior Member
Thanks Meter: 435
 
395 posts
Join Date:Joined: Dec 2013
Donate to Me
More
UPDATE: Take a look at this Xposed Module by @itandy, it'll give you the same results of this modded APK and it's easier to install (since you need only Xposed Installer). Also, it'll work in any Android version available for Xperia M, while this modded APK will work only in stock 4.2.2 ROM

As you guys may already know, Stamina Mode is a power management state included with many Xperia phones that improves battery life up to 4 times by disabling background apps/processes when the screen is locked and automatically enabling them again when screen is unlocked. However, when Stamina mode is enabled, the LED notifications are completely disabled or replaced with a generic three-time white LED notification, depending of the Android version running in your Xperia.

Third-party apps (like Light Flow) are completely disabled in Stamina Mode, even if you whitelist it. So, based on the info posted by @quisvir I managed to mod SuperStamina.apk from Xperia M dual. The APK used on Android 4.2 based ROMs seems to be different, so, the enableLeds() call isn't present in the decompiled smali. Using the modded version quisvir made for Xperia SP causes boot loops on Xperia M dual (C2004/C2005), so I researched a little and after some tests, I got the changes working...

The only file that was modified in this mod is smali/com/sonymobile/superstamina/xssm/Xssm.smali, where I removed these lines from the method setPowerStateLocked:
Code:
iget-object v0, p0, Lcom/sonymobile/superstamina/xssm/Xssm;->mService:Lcom/sonymobile/superstamina/XperiaPowerService;
invoke-virtual {v0, v13}, Lcom/sonymobile/superstamina/XperiaPowerService;->enableLedsOverride(Z)V
I tested the modded APK in Xperia M dual (C2004/C2005) running 4.2.2 and it works flawlessly, even with third-party apps, but it should work with any Xperia running stock ROM based on Android 4.2. It won't work in Xperia M (C1904/C1905) unless you have crossflashed it with 4.2.2 firmware from Xperia M dual. It'll also won't work in 4.3 firmware. If you have Xperia M running 4.1 and don't want to crossflash, the Xperia SP version from quisvir may work.

To install the mod, you'll need root access and a file manager (like Root Explorer or ES File Manager) to replace the original APK in /system/app. Also, make sure to set permissions to 0644. After that, reboot your phone and your LED notifications should work even with Stamina Mode on.
Attached Files
File Type: apk SuperStamina.apk - [Click for QR Code] (569.3 KB, 457 views)
Last edited by mbc07; 19th May 2014 at 04:41 PM.
The Following 2 Users Say Thank You to mbc07 For This Useful Post: [ View ]
4th January 2014, 05:48 PM   |  #2  
Junior Member
Thanks Meter: 3
 
27 posts
Join Date:Joined: Dec 2013
Quote:
Originally Posted by mbc07

As you guys may already know, Stamina Mode is a power management state included with many Xperia phones that improves battery life up to 4 times by disabling background apps/processes when the screen is locked and automatically enabling them again when screen is unlocked. However, when Stamina mode is enabled, the LED notifications are completely disabled or replaced with a generic three-time white LED notification, depending of the Android version running in your Xperia.

Third-party apps (like Light Flow) are completely disabled in Stamina Mode, even if you whitelist it. So, based on the info posted by quisvir I managed to mod SuperStamina.apk from Xperia M dual. The APK used on Android 4.2 based ROMs seems to be different, so, the enableLeds() call isn't present in the decompiled smali. Using the modded version quisvir made for Xperia SP causes boot loops on Xperia M dual (C2004/C2005), so I researched a little and after some tests, I got the changes working...

The only file that was modified in this mod is smali/com/sonymobile/superstamina/xssm/Xssm.smali, where I removed these lines from the method setPowerStateLocked:

Code:
iget-object v0, p0, Lcom/sonymobile/superstamina/xssm/Xssm;->mService:Lcom/sonymobile/superstamina/XperiaPowerService;
invoke-virtual {v0, v13}, Lcom/sonymobile/superstamina/XperiaPowerService;->enableLedsOverride(Z)V
I tested the modded APK in Xperia M dual (C2004/C2005) and it works flawlessly, even with third-party apps (don't forget to whitelist them), but it should work with any Xperia running stock ROM based on Android 4.2. It won't work on Xperia M (C1904/C1905) unless you have crossflashed it with Xperia M dual firmware. This is because Xperia M runs Android 4.1, while Xperia M dual is on 4.2. If you have Xperia M and don't want to crossflash, the Xperia SP version from quisvir may work.

To install the mod, you'll need root access and a file manager (like Root Explorer or ES File Manager) to replace the original APK in /system/app. Also, make sure to set permissions to 0644. After that, reboot your phone and your LED notifications should work even with Stamina Mode on, but don't forget to whitelist your third-party app.


good app thnks
28th January 2014, 12:03 PM   |  #3  
Junior Member
Thanks Meter: 0
 
24 posts
Join Date:Joined: Jan 2014
thanks man
28th February 2014, 11:40 PM   |  #4  
Member
Thanks Meter: 3
 
96 posts
Join Date:Joined: Feb 2014
...
thanks man
4th March 2014, 04:28 PM   |  #5  
Junior Member
Thanks Meter: 0
 
1 posts
Join Date:Joined: Mar 2013
Thanks bro

Sent from my C1904 using XDA Premium 4 mobile app
4th March 2014, 07:05 PM   |  #6  
mbc07's Avatar
OP Senior Member
Thanks Meter: 435
 
395 posts
Join Date:Joined: Dec 2013
Donate to Me
More
No need to post guys, just hit the thanks button...
Post Reply Subscribe to Thread

Tags
sony, stamina, stamina mode, xperia, xperia m
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes