Attend XDA's Second Annual Developer Conference, XDA:DevCon 2014!
5,772,395 Members 46,906 Now Online
XDA Developers Android and Mobile Development Forum

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

Tip us?
 
mbc07
Old
(Last edited by mbc07; 19th May 2014 at 03:41 PM.)
#1  
mbc07's Avatar
Senior Member - OP
Thanks Meter 406
Posts: 376
Join Date: Dec 2013
Default [Mod] [4.2.2] LED notifications with Stamina Mode enabled

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, 424 views)
The Following 2 Users Say Thank You to mbc07 For This Useful Post: [ Click to Expand ]
 
horamankurdish
Old
#2  
Junior Member
Thanks Meter 3
Posts: 27
Join Date: Dec 2013
Quote:
Originally Posted by mbc07 View Post
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
 
bahrawy500
Old
#3  
Junior Member
Thanks Meter 0
Posts: 23
Join Date: Jan 2014
thanks man
 
abuzer3
Old
#4  
Member
Thanks Meter 3
Posts: 96
Join Date: Feb 2014
Default ...

thanks man
 
vipul1992
Old
#5  
Junior Member
Thanks Meter 0
Posts: 1
Join Date: Mar 2013
Thanks bro

Sent from my C1904 using XDA Premium 4 mobile app
 
mbc07
Old
#6  
mbc07's Avatar
Senior Member - OP
Thanks Meter 406
Posts: 376
Join Date: Dec 2013
No need to post guys, just hit the thanks button...
Sony Xperia M dual [C2004]
ROM: 15.5.A.1.5 (stock)
Android version: 4.3 (rooted)
Bootloader: locked (unlockable)
Tags
sony, stamina, stamina mode, xperia, xperia m
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes