[MOD][APP][XPOSED][4.1+] Power Nap for Xposed - Sony's Stamina Mode for all devices!

Search This thread

waylaidwanderer

Senior Member
Feb 19, 2012
189
799
On the Moto G LTE, stock 5.1 I'm getting in the XPOSED Logs:

I/XPOSED (1384) [Power Nap] System tried to update inactive wakelock, returning null

Could you please provide an explanation of this for users who may be seeing this as well. It would be much appreciated and this has come up before in the comments but no answer was provided. It would help alleviate any concerns that something is not working or a conflict is occurring somewhere.

Thank you, in advance. Your input would be appreciated.

S.

I must have missed it. For those of you who are wondering: it's more of a debug message than anything else. Before this "returning null" was implemented, the system would crash if it tried to update the inactive wakelock. It's basically just a crash-prevention thing.
 

sdembiske

Senior Member
Jan 4, 2015
1,420
1,942
Thank you ...

I must have missed it. For those of you who are wondering: it's more of a debug message than anything else. Before this "returning null" was implemented, the system would crash if it tried to update the inactive wakelock. It's basically just a crash-prevention thing.

Appreciate the quick response. Thank you again your work is very much appreciated..
S.
 
update::

Ran the above apk with the following results

Xposed logs show powernap is not working
xposed log:https://www.dropbox.com/s/87n6lgy161xpcxy/xposed_error_20161113_104745.log?dl=0

Statistics broken (or powernap broken? unable to see any stats)
screenshot:http://imgur.com/OWB1HzF

My whitelist http://imgur.com/cHUpA04
BetterBatteryStats: http://imgur.com/EYkY1j9

Going back to Paystore v0.8.1a (October 26, 2016) to see if still broken.
@waylaidwanderer
https://github.com/waylaidwanderer/PowerNapForXposed-Development/issues/9#issuecomment-260166171
 
Last edited:
  • Like
Reactions: leonardoroza

ivanchin99

Senior Member
Aug 13, 2010
333
35
Try the attached APK and let me know if it fixes your issue.

Seemed to have fixed the random reboot problem and battery level is more sustained now so it is indeed working as intended.

However the statistic screen is blank so there's that .. :D

Edit: Scrap that, it's not working as there are tons of wakelock shown in better battery stats. So Powernap in the attached is not working. However, no random reboot happened - due to it not working?
 
Last edited:
N

notauseranymore

Guest
I've a question @waylaidwanderer. Say I have Whatsapp whitelisted, but I also whitelisted its alarm: Client_Pinger_Action for daytime only. Does that mean Power Nap will still block that alarm at night?

Or for the alarm whitelist to work I must not whitelist the app itself?

Anyone with experience with it feel free to gimme your input.
 

broky

Senior Member
Jan 31, 2009
866
352
powernap is not in the list of running services,only when i start it manually it stays in the running applications list.
should work like this? should i see it in running services?
i have no task killer installed(xperia z1 compact)
 

AnonVendetta

Senior Member
Apr 29, 2016
1,702
618
Is Power Nap useless on Marshmallow? I've tried it and it didn't seem to have any real effect. I've even noticed it sometimes using a substantial amount of battery. This app used to work extremely well on Lollipop.

Right now I'm using ForceDoze to supplement MM's Doze Mode for increased battery savings when screen is off. I've also whitelisted PN in ForceDoze (and from battery optimization), still no substantial difference. Both apps are activated in Xposed Installer too.

Is there a way to get PN running optimally on MM, or should I just ditch it and use Doze instead? Any plans to create a new, updated version of PN that works better with MM/Nougat, or maybe even to make it somehow work together with Doze?

Thanks!
 

rradix

Senior Member
May 17, 2015
78
18
Is Power Nap useless on Marshmallow? I've tried it and it didn't seem to have any real effect. I've even noticed it sometimes using a substantial amount of battery. This app used to work extremely well on Lollipop.

Right now I'm using ForceDoze to supplement MM's Doze Mode for increased battery savings when screen is off. I've also whitelisted PN in ForceDoze (and from battery optimization), still no substantial difference. Both apps are activated in Xposed Installer too.

Is there a way to get PN running optimally on MM, or should I just ditch it and use Doze instead? Any plans to create a new, updated version of PN that works better with MM/Nougat, or maybe even to make it somehow work together with Doze?

Thanks!

Are you running on CM13? I have this problem before on CM13. Never solved it. I also have the force doze app, powernap but it seems like phone is still waking up after screen off. I got fed up and switched to another ROM to make it work.
 

AnonVendetta

Senior Member
Apr 29, 2016
1,702
618
@rradix: No, not CM13, I'm running Marshmallow stock ROM on LG v10.

I've also noticed that Power Nap isn't requesting root access (and it should be). I'm not using SuperSU anymore, I switched to open source phh's Superuser a few months ago.
 

rradix

Senior Member
May 17, 2015
78
18
@rradix: No, not CM13, I'm running Marshmallow stock ROM on LG v10.

I've also noticed that Power Nap isn't requesting root access (and it should be). I'm not using SuperSU anymore, I switched to open source phh's Superuser a few months ago.

Oh. Sorry can't help you on that.

BTW, yes. The latest powernap does not request super user rights unless necessary.

Are you on the alpha build or the old powernap?
 

leonardoroza

Senior Member
Jun 9, 2012
404
98
Apps & Games
Xiaomi Mi 6
Here it makes big difference with GPS, as Doze itself doesn't. CM13.
 

Attachments

  • Screenshot_20161129223412.jpg
    Screenshot_20161129223412.jpg
    48.1 KB · Views: 1,094

Top Liked Posts

  • There are no posts matching your filters.
  • 506
    Introduction

    As the owner of an Xperia Z3, I found myself missing Stamina Mode after flashing a CM12 ROM. None of the battery apps in the Play Store worked the same way - most of the ones I found merely disabled Wi-Fi/data while the screen was off, along with managing auto-sync, but I still wanted whitelisted apps to be able to access the internet.

    I spent a good 12 hours straight working to replicate the basic features of Stamina Mode, and now here we are: Power Nap for Xposed!

    Images

    Imgur album link for easier viewing: http://imgur.com/a/JvSD8

    7VtGH1q.png

    Cy1bh4t.png

    gysUudu.png

    CF7vaJQ.png

    Czq2RUf.png



    Description

    Compatible with any Android device running 4.1+, with root and Xposed.

    Power Nap for Xposed is the best app for saving battery. When your screen is off, Power Nap maximizes your device's deep sleep time by stopping services, alarms and wakelocks from waking the device when the screen is off. This means you can leave Wi-Fi/data on and still get the notifications from apps you have whitelisted, while all others are unable to wake up your device, leading to an increase in your battery life.

    Power Nap for Xposed also has a Low Battery Mode, where you can selectively functions to save power when battery level is low.

    Power Nap for Xposed is inspired by Sony's Stamina Mode, but accessible for all Android devices 4.1 and higher. This app requires root and Xposed.

    Be sure to whitelist any third-party alarm clock app you are using, or it will be prevented from waking up your device!

    Permissions

    android.permission.INTERNET: this is for Crashlytics only, which will automatically send me stack trace logs if the app crashes due to something non-Xposed related. No other information is being sent.
    android.permission.WRITE_SETTINGS: For Low Battery Mode, to change screen brightness and screen display timeout
    android.permission.READ_SYNC_SETTINGS: For Low Battery Mode, to check if auto-sync is on/off
    android.permission.WRITE_SYNC_SETTINGS: For Low Battery Mode, to turn on/off auto-sync
    android.permission.ACCESS_WIFI_STATE: For Low Battery Mode, to check if Wi-Fi is on/off
    android.permission.CHANGE_WIFI_STATE: For Low Battery Mode, to turn on/off Wi-Fi
    android.permission.ACCESS_NETWORK_STATE: For Low Battery Mode, to check if mobile data is on/off
    android.permission.BLUETOOTH: For Low Battery Mode, to check if Bluetooth is on/off
    android.permission.BLUETOOTH_ADMIN: For Low Battery Mode, to turn on/off Bluetooth
    android.permission.RECEIVE_BOOT_COMPLETED: For Low Battery Mode, to start a service that monitors the current battery level (if LBM is enabled), when the device is finished booting

    Installation Instructions

    To get the app, you can either opt-in for testing on Google Play (and/or join the G+ Alpha testing community if you're interested in helping out by reporting bugs and sharing your experiences), or simply download it directly from the Xposed Module Repository. You may need to change "Versions to be shown" to "Experimental" in the Xposed Installer's Settings to be able to download it using the app.

    The latest APK version is also attached to the "Download" tab of this thread, but you will not receive updates using this method.

    Final Thoughts

    By using Power Nap, you can expect to see as little as 0.2% battery drain per hour (if you don't have many apps whitelisted) during standby. Results may vary by device and depending on which apps have been whitelisted.

    Since it's in Alpha mode, please feel free to leave feedback and report bugs. If you need any clarifications on any aspect of the app, please leave a comment!

    NEW ISSUE TRACKER - POST ISSUES HERE

    XDA:DevDB Information
    Power Nap for Xposed, Xposed for all devices (see above for details)

    Contributors
    waylaidwanderer
    Xposed Package Name: net.jzhang.powernap

    Version Information
    Status: Alpha
    Current Beta Version: 0.8a
    Beta Release Date: 2015-04-09

    Created 2015-04-09
    Last Updated 2016-10-22
    38
    Hi everyone, Power Nap v0.8 Alpha is now available on the Play Store!

    Mirror: http://dl-xda.xposed.info/modules/net.jzhang.powernap_v8_e3c396.apk

    Opt-in for testing
    Google Play link

    Changelog v0.8a (October 22, 2016)

    - added App Settings (click on app in whitelist to set active hours and allow only certain wakelocks)
    - warn the user if module is not enabled
    - fixed swipe to delete not working
    - fix stats not showing up on some devices
    - only ask for root if necessary

    NEW ISSUE TRACKER
    25
    Power Nap 0.8.1a has been uploaded to the Play Store and Xposed repo. There are still lingering issues with statistics not showing up for some people, so I decided to release the fix for the bootloops first.

    Direct download link: http://dl-xda.xposed.info/modules/net.jzhang.powernap_v9_38ab23.apk

    Changelog v0.8.1a (October 26, 2016)

    - fixed bootloop on Android 5.x
    - fix module not working on some 4.x devices
    - update Crashlytics library
    - fix force close when phone reaches low battery level with LBM enabled on Android 6.x (will ask for necessary permission first)
    - some more fixes for statistics not showing up: for those still experiencing issues, post on the issue tracker @ https://github.com/waylaidwanderer/PowerNapForXposed-Development/issues/2
    24
    Power Nap for Xposed is now available for download on the Xposed Module Repository: http://repo.xposed.info/module/net.jzhang.powernap

    You may need to change "Versions to be shown" to "Experimental" in the Xposed Installer's Settings to be able to download it using the app.

    You can also find the latest APK attached to the "Download" tab of this thread.
    21
    Good news, I've discovered the cause of the bootloop issue and fixed it. Funnily enough, I never ran into the problem because it seems to affect < 6.0 devices only. The fix will be available in the next update, once I sort out a bug with statistics not displaying for some people (again).