FORUMS

Which OEM Would You Like to Help?

Most manufacturers have moments of greatness and moments of decadence, and in the past few years … more

Root T-Mobile S6/Edge on 5.1.1 Without Tripping Knox

If you purchase phones from a carrier, you may be no stranger to the difficulties … more

IonVR Coming Soon, HTC M9 Dev Edition Gets Android 5.1 – XDA TV

The HTC M9 Developer Edition has received Android 5.1. That and … more

Android 5.1.1 Omni ROM For Motorola Xoom

Back in Feb 2011, the Motorola Xoom became the first device to be sold with Android 3.0 … more

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

479 posts
Thanks Meter: 570
 
Post Reply Subscribe to Thread Email Thread
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, 601 views)
Last edited by mbc07; 19th May 2014 at 03:41 PM.
The Following 2 Users Say Thank You to mbc07 For This Useful Post: [ View ]
 
 
4th January 2014, 04:48 PM |#2  
Member
Thanks Meter: 3
 
More
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, 11:03 AM |#3  
Junior Member
Thanks Meter: 0
 
More
thanks man
28th February 2014, 10:40 PM |#4  
Member
Thanks Meter: 3
 
More
...
thanks man
4th March 2014, 03:28 PM |#5  
Junior Member
Thanks Meter: 0
 
More
Thanks bro

Sent from my C1904 using XDA Premium 4 mobile app
4th March 2014, 06:05 PM |#6  
mbc07's Avatar
OP Senior Member
Thanks Meter: 570
 
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