Greenify + Whatsapp + Doze + Notifications - Greenify

Hello,
I was having issues with Greenify + Doze + LED notifications, so I decided not to optimize battery for Whatsapp and not to Greenify it neither.
I was optimizing the rest and in the end Whatsapp became the most battery consuming application on my phone. So I dug into that again. I did not find how it could be done on the net. Sorry if there is a cleaner solution, I never found it. This post is intended to share my findings.
What you can expect? You can expect to activate Doze, to Greenify Whatsapp and still receive real-time notifications via LED.
What could I not make work? Doze battery optimization for Whatsapp.
My configuration: Android Marshmallow, Greenify 2.9, Whatsapp 2.16.225
You require: Xposed, Greenify paid version, Xposed module XLED and, for sure, Whatsapp.
I think that the trick is done thanks to XLED module. I also tried Light Flow and it seems to work. However, it seemed to consume more battery than Whatsapp itself.
XLED, on the contrary, does not consume battery “at all”, at least it doesn't appear in the top of battery consuming records.
Greenify configuration:
Installed with Xposed (set to boost)
Paid version
Deep hibernation activated
Aggressive doze activated
All Xposed options enabled except the one concerning the vulnerability in previous versions of Android 4.3
Whatsapp is not optimized for Doze (on System, Battery, Battery optimization). If I let Whatsapp optimized, I loose notifications.
On XLED module, I create a configuration for Whatsapp: I activate “Enable custom LED”, and “Force LED Flashing”. The rest, I leave with default values.
To reduce even more battery, I removed for Whatsapp the right to “Keep awake” via AppOpsXposed. This is for sure optional.
And that is. For me, so far, so good.
PS: What I am missing is the Doze battery optimization and the vibration in Doze mode. I do not know how to enable vibration on Doze. It is maybe against the principle of Doze but still I miss it.

thanks. i really need whatsapp no matter what...
even i add it to white list.. no it didnt work. i paid it. now i will try your method

Related

[GUIDE] Aggressive Doze - New experimental feature for Marshmallow (NO ROOT REQUIRED)

"Aggressive Doze" is one of the new experimental features exclusive for Android 6.0 Marshmallow. The best part is that it works on non-rooted device!
Once enabled in settings, your device will enter Doze Mode in minutes (instead of hours stationary normally) after the screen goes off if not charging, to improve its power-saving efforts.
Doze mode is a new power saving mechanism introduced in Android 6.0. In this mode, background behaviors of all apps (except white-listed ones) are strictly prohibited, until next user interaction or charging. The device will also periodically (in hours) exit doze mode briefly.
This is not the complete solution for a better Doze, currently it still cannot keep your device rest in doze if you are carrying it around. It is expected to maximize the power-saving effect of the stock Doze mode. (UPDATE: This "interruption by motion" behavior can be completely prevented in the newest version 2.9 beta, see FAQ.1 for details) Also it may break some background functionality of your daily apps if they are not developed with Android Doze in mind.
FAQ
When I'm moving around, the Aggressive Doze is not working?
Android system uses a low power "Significant Motion Sensor" to track movement and exits Doze Mode if significant movement is detected. Aggressive Doze will not try to enter Doze after that, to avoid constantly entering and exiting Doze. Since the stock Doze is designed for battery-saving in stationary state, Android still wants to keep your apps in sync with fresh state if you are carrying it around.
In the new version 2.9 beta, this "interruption by motion" behavior can be prevented completely if "DUMP" permission is granted manually via USB-connected computer.
Click to expand...
Click to collapse
Why is my device very lagging when wake from sleep after a few hours.
This seems like a bad consequence of Android Doze Mode itself if too many apps are installed. Because Doze Mode effectively postpone all the background behaviors during the doze. The longer doze lasts, the more tasks to do when exiting. Consider greenifying more background-itchy apps to reduce the lag, because hibernation is still the essential solution for them.
Click to expand...
Click to collapse
Aggressive Doze is not working sometimes, but again working later.
Check whether there's a alarm clock in less than an hour, by looking for an alarm icon in the status bar. But the icon won't tell you the time of the alarm. You may click the DND tile in the quick launch panel to find out the actual time of the alarm (in the entry with "until next alarm"). This is because Android system refuses to enter doze mode if an scheduled alarm is in less than an hour.
Click to expand...
Click to collapse
Why I can't find this option in settings? My device is on Android 6.0.
Aggressive Doze in Greenify v2.8 should work on all devices with Android 6+, unless the Doze Mode is explicitly disabled by the ROM. If you are using a custom ROM made by community, ask the
ROM modder to enable this flag in the ROM:
Code:
com.android.internal.R.bool.config_enableAutoPowerModes
UPDATE: Since 2.9 beta 1, even if doze is disabled in ROM, Greenify can still activate doze mode after DUMP permission is granted manually via USB-connected computer. Beware, this may break things since the ROM is not made to be compatible with Doze.
Click to expand...
Click to collapse
oasisfeng said:
Within the new version 2.8 beta (rolling out), there's an early attempt for better Doze mode in control. It currently activate doze mode as early as the screen goes off, and deactivate it when the screen is back on or the charger is connected.
It is surely not the complete solution for a better Doze mode. It is expected to maximize the power-saving effect of Doze mode, but may also break some background functionality of your apps. So I'm listening to all your feedback and opinions, to build a smarter and finer-tweaked Doze mode in Android 6.0.
Together with the "Shallow Hibernation" released in version 2.7, let's start a new adventure of Greenify with Android Marshmallow.
Click to expand...
Click to collapse
Thanks buddy! Lets start again
Hi Oasis, I tried to perform the steps you gave but I am getting the following error
/system/bin/sh: grant: not found
this happens when I try to run the first command to grant DUMP permissions. My Nexus 5 is not rooted and ADB is running and fully up to date.
Edit: for anyone experiencing this issue try the following
1. After checking "adb devices" run "adb shell"
2. Type "pm grant com.oasisfeng.greenfiy android.permission.DUMP"
3. Type "pm grant com.oasisfeng.greenify android.permission.READ_LOGS"
Hello,
First of all, i'm happy with the donation version!
With this new feature there's a thing I've noticed right away. Apparently doze works with all the apps, including whatsapp, which is the app i use the most.
When doze it's activated messages arrive in intervals and it's not that reliable. Anyways, when doze activates by itself, i'm ok with the messages getting delayed, because i'm actually not using the phone. The thing with the integration through greenify, is that messages stop arriving right away.
Do you think there could be a way to kind of "bypass" certain applications? If it's possible it would work like stamina mode from Sony.
Anyways, it's just a comment... I like the instant doze since doze really helps with battery!
blanco2701 said:
Hello,
First of all, i'm happy with the donation version!
With this new feature there's a thing I've noticed right away. Apparently doze works with all the apps, including whatsapp, which is the app i use the most.
When doze it's activated messages arrive in intervals and it's not that reliable. Anyways, when doze activates by itself, i'm ok with the messages getting delayed, because i'm actually not using the phone. The thing with the integration through greenify, is that messages stop arriving right away.
Do you think there could be a way to kind of "bypass" certain applications? If it's possible it would work like stamina mode from Sony.
Anyways, it's just a comment... I like the instant doze since doze really helps with battery!
Click to expand...
Click to collapse
+1
In the developer preview of 6.0 you could exclude apps from being doze'd. Such an option would be great in Greenify as well, since messages don't wake up the phone with activated aggressive doze
shakuyi said:
Hi Oasis, I tried to perform the steps you gave but I am getting the following error
/system/bin/sh: grant: not found
this happens when I try to run the first command to grant DUMP permissions. My Nexus 5 is not rooted and ADB is running and fully up to date.
Edit: for anyone experiencing this issue try the following
1. After checking "adb devices" run "adb shell"
2. Type "pm grant com.oasisfeng.greenfiy android.permission.DUMP"
3. Type "pm grant com.oasisfeng.greenify android.permission.READ_LOGS"
Click to expand...
Click to collapse
Sorry for the typo, I just corrected it in the online guide. Thanks for the report.
blanco2701 said:
Hello,
First of all, i'm happy with the donation version!
With this new feature there's a thing I've noticed right away. Apparently doze works with all the apps, including whatsapp, which is the app i use the most.
When doze it's activated messages arrive in intervals and it's not that reliable. Anyways, when doze activates by itself, i'm ok with the messages getting delayed, because i'm actually not using the phone. The thing with the integration through greenify, is that messages stop arriving right away.
Do you think there could be a way to kind of "bypass" certain applications? If it's possible it would work like stamina mode from Sony.
Anyways, it's just a comment... I like the instant doze since doze really helps with battery!
Click to expand...
Click to collapse
If WhatsApp uses GCM for instant message push, then maybe the developer has not yet adopted for the priority GCM push which goes through in the Doze mode. This is what Google suggests all IM message to use.
I'll try to work around this issue, maybe allow all GCM push to exit doze mode for a while.
MrMarques01 said:
+1
In the developer preview of 6.0 you could exclude apps from being doze'd. Such an option would be great in Greenify as well, since messages don't wake up the phone with activated aggressive doze
Click to expand...
Click to collapse
You can still do that in Android 6.0 final version, but highly discouraged.
Today I got Greenify 2.8 beta 1, but still my apps aren't greenified.
Edit: I reinstalled Greenify and su asked me for permission, now it works, thank you.
Best regards
Matthias
If we are rooted does it still require the one-time procedure or can we just install as normal?
oasisfeng said:
Within the new version 2.8 beta (rolling out), there's an early attempt for better Doze mode in control. It currently activate doze mode as early as the screen goes off, and deactivate it when the screen is back on or the charger is connected.
The best part of this feature - NO ROOT REQUIRED! Still you need to perform a one-time procedure with USB-cable and a connected computer, which is surely familiar to many of you XDA members.
This is not the complete solution for a better Doze mode. It is expected to maximize the power-saving effect of Doze mode, but may also break some background functionality of your apps. So I'm listening to all your feedback and opinions, to build a smarter and finer-tweaked Doze mode in Android 6.0.
Together with the "Shallow Hibernation" released in version 2.7, let's start a new adventure of Greenify with Android Marshmallow.
Click to expand...
Click to collapse
Oasisfeng, what's the normal amount of time before doze activates? Would it perhaps be better to have an option to set the amount of minutes after screen off to start the aggresive Doze?
I just test greenify beta, and battery seems like always for now... Tomorrow I'll see better how new greenify works...
No root really ? It would be useful
@oasisfeng
mine is rooted but still the Doze feature is not activated.
Is it only for 6.0 devices?
atulclassic said:
@oasisfeng
mine is rooted but still the Doze feature is not activated.
Is it only for 6.0 devices?
Click to expand...
Click to collapse
Yes.
atulclassic said:
@oasisfeng
mine is rooted but still the Doze feature is not activated.
Is it only for 6.0 devices?
Click to expand...
Click to collapse
*Clears throat* "Aggressive Doze" is a new experimental feature for Android 6.0
Smultie said:
Oasisfeng, what's the normal amount of time before doze activates? Would it perhaps be better to have an option to set the amount of minutes after screen off to start the aggresive Doze?
Click to expand...
Click to collapse
I‘m thinking about the same thing.It'd be great to have an option to set the time to start the doze mode. It'd be so damn perfect!
Do applications which are set to bypass Doze still work?
randy6644 said:
I‘m thinking about the same time. It'd be great to have an option to set the time to start the doze mode. It'd be so damn perfect!
Click to expand...
Click to collapse
Great minds think alike!
Smultie said:
Oasisfeng, what's the normal amount of time before doze activates? Would it perhaps be better to have an option to set the amount of minutes after screen off to start the aggresive Doze?
Click to expand...
Click to collapse
Currently zero. I'm planning for a smarter delay before doze (probably the same as the delay before greenified apps hibernate). But for now, I'd like to push the benefit to the limit for a test run and find the actual drawback of 0 delay.

How to know if aggressive doze is functioning?

If I've understood correctly there's no need to hibernate anything in order to user aggressive doze. So I don't use hibernation at all, but instead would like to user aggressive doze.
I'm rooted and have checked the on-the-go mode. I have also enabled the notification.
But there's no doze notification after the screen has been off for few minutes. How do I know if it is dozing or not?
thanks
tofu said:
If I've understood correctly there's no need to hibernate anything in order to user aggressive doze. So I don't use hibernation at all, but instead would like to user aggressive doze.
I'm rooted and have checked the on-the-go mode. I have also enabled the notification.
But there's no doze notification after the screen has been off for few minutes. How do I know if it is dozing or not?
thanks
Click to expand...
Click to collapse
I use Automagic (same idea as Tasker, but I find it much easier to understand and use). It has a trigger for when the phone enters doze mode (and another for when it exits). I can use these triggers to perform conditional actions like enable/disable Bluetooth/WiFi etc., or, say, make a sound, send a message to my Pebble watch, etc. In my case (unrooted phone) I have it make sounds. Using Automagic to do this kind of stuff does not seem to mess up the phone going into/coming out of doze mode.
You can also enable a Greenify notification that shows when the phone goes in/out of aggressive doze...
WibblyW said:
I use Automagic (same idea as Tasker, but I find it much easier to understand and use). It has a trigger for when the phone enters doze mode (and another for when it exits). I can use these triggers to perform conditional actions like enable/disable Bluetooth/WiFi etc., or, say, make a sound, send a message to my Pebble watch, etc. In my case (unrooted phone) I have it make sounds. Using Automagic to do this kind of stuff does not seem to mess up the phone going into/coming out of doze mode.
You can also enable a Greenify notification that shows when the phone goes in/out of aggressive doze...
Click to expand...
Click to collapse
Thanks. It seems that it works now. I just needed to wait for a longer time.
Just remember that doze is not a full replacement for hybernation. It may prevent wakelocks but bad apps can still run background processes loading CPU and consuming battery when phone periodically wakes up from doze as well as every time you are using your phone.
Sent from my OnePlus 2 using Tapatalk

Hibernate and aggressive doze

I'm using CM13 and new to using Greenify as I just bought the donation package but have some questions that I'm not sure about.
1. I have instant messaging apps (Whatsapp and WeChat) and games on my phone, when I finish using the app, I press the home button and have them running in the background, does that uses more battery or do I need to add the apps to the hibernation list?
2. Should I use hibernate or shallow hibernation as I switched from iPhone to OnePlus 3 and on the iPhone when I reopen the app, it will return to where I left it.
3. I have enabled aggressive doze so that it will go to sleep mode when the screen is off, will I get delay Whatsapp and Wechat messages or do I need to add it to the whitelist so notifications comes instantly when I receive them?
Many thanks!
Lither said:
I'm using CM13 and new to using Greenify as I just bought the donation package but have some questions that I'm not sure about.
1. I have instant messaging apps (Whatsapp and WeChat) and games on my phone, when I finish using the app, I press the home button and have them running in the background, does that uses more battery or do I need to add the apps to the hibernation list?
2. Should I use hibernate or shallow hibernation as I switched from iPhone to OnePlus 3 and on the iPhone when I reopen the app, it will return to where I left it.
3. I have enabled aggressive doze so that it will go to sleep mode when the screen is off, will I get delay Whatsapp and Wechat messages or do I need to add it to the whitelist so notifications comes instantly when I receive them?
Many thanks!
Click to expand...
Click to collapse
1. Any app which is not greenified will run in the background once it is opened and then dismissed by the Home button. As far as the IM apps are concerned, the advice of the Dev is not to greenify them if you rely on them. However, some people have successfully greenified those IM apps which use GCM without issues but some others complain of delayed notifications. So it may be better not to greenify them if you rely on them. Of course they will consume more battery since they are running in the background.
2. If you want iPhone like behaviour, use shallow hibernation. Otherwise, the apps will start afresh.
3. It is better to add such apps to the white list.
i could be wrong.... but i noticed that most of the times aggressive doze does NOT exted the real battery life...... maybe it COULD extend it if you do not touch the phone for long periods like 2...4 hours at time, but if you make a normal usage of the phone i suspect that activating and deactivating doze is DRAINING more battery than it tries to save!!!
.........any other though?
realista87 said:
i could be wrong.... but i noticed that most of the times aggressive doze does NOT exted the real battery life...... maybe it COULD extend it if you do not touch the phone for long periods like 2...4 hours at time, but if you make a normal usage of the phone i suspect that activating and deactivating doze is DRAINING more battery than it tries to save!!!
.........any other though?
Click to expand...
Click to collapse
Similar observation on battery savings. In most cases any power related benefits of aggressive doze are wiped out when the device wakes from its comma and performs a bunch of 'catch up' tasks. Such behavior can lead to lag immediately after wake which is a common complaint associated with aggressive doze. That said, aggressive doze may have other situational benefits...especially over longer durations. As always YMMV.
yes, i think about a person who does pick up the phone just every 4...5 hour at day because it is not important (for him) to always check the latest messages, and in that condition it could be useful the aggressive doze.
i even noticed that to disable the movement sensors is NOT a great thing...... of course great if someone is in car or moving everytime but it has the CON of turning on/off the brightness sensor of the phone and at every display power on the phone lags for 1/2 seconds.
i must admit that in the last years i've always used aggressivedoze/ or naptime and greenified lots of apps but i should reconsider the fact to UNinstall all....... and see if the battery life is really worse or not.
realista87 said:
yes, i think about a person who does pick up the phone just every 4...5 hour at day because it is not important (for him) to always check the latest messages, and in that condition it could be useful the aggressive doze.
i even noticed that to disable the movement sensors is NOT a great thing...... of course great if someone is in car or moving everytime but it has the CON of turning on/off the brightness sensor of the phone and at every display power on the phone lags for 1/2 seconds.
i must admit that in the last years i've always used aggressivedoze/ or naptime and greenified lots of apps but i should reconsider the fact to UNinstall all....... and see if the battery life is really worse or not.
Click to expand...
Click to collapse
The sensor issue is device specific. I enable 'doze on the go' on all my devices and have yet to encounter the brightness glitch. However, I don't use the more aggressive sensor suppressions available in some apps. Note 'doze on the go' is enabled by default w/Android 7+.
After experimenting with countless apps/tools/techniques (ugh) my Android power management methodology has evolved to a 'lite touch' minimalist approach. I only take overt action when a specific drain can not be contained by other means. Greenify is the tool of choice with only a few bad actors in the explicit hibernation list. Android defaults handle everything else. My devices sleep soundly, behave predictably and score admirably low drain rates. App selection obviously plays into that. Big pigs like Facebook, Google everything and WhatsApp are not part of my portfolio as lighter alternatives exist. Good luck with your own adventures.

greenify and the oneplus 3t

Does the app and the built in function of the o+3t do exactly the same thing or would installing the app improve battery life?
I'm curious as well on my OP5
Eggstones said:
Does the app and the built in function of the o+3t do exactly the same thing or would installing the app improve battery life?
Click to expand...
Click to collapse
Im using Greenify with my (ROOTED) o+3t. I made some test sessions with BBS and Geenify (with AD) improve MY battery life. I also hibernating few apps that waking up device too often. You need try and check if it can improve yours battery life. But with my device it does.
EDIT: Oneplus removed that built in function few betas ago. But what i remember it didnt worked with notifications so good than greenify does.
Any tip not to loose notifications?
I'm using Greenify on a rooted OP3T (OOS OB 13) and I'm getting good battery life with more that 7h SOT.
Only in the same time I have lost most of my notifications. And all the settings (Battery Optimization, Advanced Optimization, Nougat doze mode and Greenify) and last OS changes (aggressive doze seems to no longer be there), I getting a bit lost into trial and fail.
Any advice on how to make the best use of Greenify on my device, without loosing notification would be welcome.
mr.charlie said:
I'm using Greenify on a rooted OP3T (OOS OB 13) and I'm getting good battery life with more that 7h SOT.
Only in the same time I have lost most of my notifications. And all the settings (Battery Optimization, Advanced Optimization, Nougat doze mode and Greenify) and last OS changes (aggressive doze seems to no longer be there), I getting a bit lost into trial and fail.
Any advice on how to make the best use of Greenify on my device, without loosing notification would be welcome.
Click to expand...
Click to collapse
Assuming Android 6.x base:
- you will need to install Xposed Framework and the donation build of Greenify for best results
- enable "Doze on the go" which is perhaps the most important tweak on MM
- also enable wake-up timer coalescing and permission to Greenify system apps
- forget about aggressive/shallow doze and/or deep hibernation (reasons are outside scope of this post); likely the source of your notification issue
- temporarily disabled other power/battery optimization apps such as Amplify, Force Doze, Power Nap, etc.
- remove any apps previously excluded from battery optimization unless you are highly confident they do not perform well unless excluded
- clear all apps from Greenify's action list
That should correct any notification issues assuming Greenify and/or one of the above apps was the culprit. You can monitor and add 'bad actors' to Greenify's action list as needed. On most devices this list should be very short (assuming Android 6.x or better).

Curious about a few battery saving things. Need clarification

I know that a lot of folk use apps like Greenify, Power Nap, Amplify, Force Doze, etc along with things like Pixel Filter, Smart Pixel feature in some roms etc, but are all these really necessary with current phones?
I have used all of the above together for years but curious about if I really need to now and if they are just impacting my battery more than they save? Do I really need them all now? I'm not using ForceDoze currently as Havoc OS has it's own doze settings and aggressive profile, but I'm wondering if Power Nap is even needed if I have Greenify and Amplify.
Just trying to reduce the apps I need without compromising my standby drain as I am running into odd issues like Magisk failing to grant root after a few minutes or so uptime unless I restart the phone and quickly open the app I need to grant root (once in the allowed list, they work flawlessly. It's just the initial prompt), messages like Whatsapp/Facebook not coming through even though they are exempt from battery optimisations and whitelisted in all the above apps and fingerprint/double tap to wake not working after 10 minutes unless I hit the power button first. I feel there are conflicts going on here which I have only had since having my OnePlus 6 this month. Not an issue with my S5 with this exact setup which was running for years and all my issues are non-existent if I leave the phone stock.
I am obviously going wrong somewhere and need to figure out where.
Also, if I run pixel filter or the smart pixel feature built into Havoc OS, am I better doing that or just turning it off and lowering the brightness? Smart pixel dims the screen slightly which I have to counter by raising the brightness. That's the one thing that has me confused as to which is actually using more juice.
Just in case I am doing something wrong, I have written down what I do in order after installing a new ROM in the attempt of maximising battery life. Doesn't seem tied to Havoc OS, but to my OnePlus 6 as I never had these issue with my previous S5.
Below is after the usual TWRP, Magisk, ROM and setting up settings etc
-Install Greenify (donation package), Amplify, Power Nap, EdXposed, Riru Core, Riru Yahfa, NFS, Better Battery Stats.
-After enabling all of them in EdXposed and restarting, I fire up Greenify and turn on all Xposed features and donation features but leave smart hibernation, ignore background free and aggressive doze off.
-Greenify all games, apps I use rarely and system apps like Camera, Print Spooler and Bookmark Provider
-Open Power Nap, select Endurance mode and whitelist Magisk, EdXposed, Greenify, Tasker, Messages, Phone, WhatsApp, BBS and LastPass (Power Nap seemed to disable it's autofill service)
-Start up Amplify so it does it's checks and exit
-Set up BBS
-Remove all these apps from OS battery optimisation
-Reboot to recovery and copy over the Amplify settings file to it's folder within data/data/Amplify folder/shared prefs and restart to system. (basic Google and app specific wakelocks you will find in all Amplify guides on XDA and nothing else)
-Add Play Store, Services, Framework, Google Pay and my banking app to Magisk Hide list and EdXposed blacklist to pass SafetyNet.
And this is where my problems start happening. This is what I have done for years and I never had issues. I suppose I could do these one at a time until I hit that wall where things go wrong, but thought I would ask here in case any of you can spot the mistake. Thanks in advance for the help or roasting lol
*Edit*
If anyone has any other ideas to reduce battery drain, you can tell me. I'm trying to maximise both screen on and screen off time without compromising too much.

Categories

Resources