v3.2.2 - shallow hibernation doubts...... (similar xposed behaviour?) - Greenify

hello to all. my configuration is fritten in my firm.
i noticed some differences between standard and shallow hibernation. i tested telegram and whatsapp on standard... and of course if a person send me a text the apps are NOT WAKING UP till i open them. perfect!
but on shallow hibernation i notice they are waked up and i receive the message, ok maybe not instantly but it could take about 15/30 seconds to receive them.
is it a NORMAL BEHAVIOUR? maybe yes......
this is what i read in the settings​Shallow-hibernated apps will be woken for a brief time periodically in hours and immediately upon HIGH priority GCM push (only if GCM priority is implemented by app developer). They will also keep awake during charging
mmmhh... ok so it should be something similar to the xposed feature ( that require donation package) called "GCM push for greenified apps" ???
i am on nougat and i don't have xposed, but i have the donation package......but i thought that without xposed i would never had the possibiliti to greenify an app ....MANTAINING the possibility to receive push messages... just because for this feature it's needed xposed!!!
so at the end..... could i consider the shallow hibernation an alternative "GCM push for greenified apps" for the persons that can't have xposed? i am just a fraid that this kind of hibernation is not so much effective in terms of battery life, respecting the old/standard one...... but i wait for some users more skilled than me that could explain and reassure me....:laugh:

realista87 said:
hello to all. my configuration is fritten in my firm.
i noticed some differences between standard and shallow hibernation. i tested telegram and whatsapp on standard... and of course if a person send me a text the apps are NOT WAKING UP till i open them. perfect!
but on shallow hibernation i notice they are waked up and i receive the message, ok maybe not instantly but it could take about 15/30 seconds to receive them.
is it a NORMAL BEHAVIOUR? maybe yes......
this is what i read in the settings
Shallow-hibernated apps will be woken for a brief time periodically in hours and immediately upon HIGH priority GCM push (only if GCM priority is implemented by app developer). They will also keep awake during charging
mmmhh... ok so it should be something similar to the xposed feature ( that require donation package) called "GCM push for greenified apps" ???
i am on nougat and i don't have xposed, but i have the donation package......but i thought that without xposed i would never had the possibiliti to greenify an app ....MANTAINING the possibility to receive push messages... just because for this feature it's needed xposed!!!
so at the end..... could i consider the shallow hibernation an alternative "GCM push for greenified apps" for the persons that can't have xposed? i am just a fraid that this kind of hibernation is not so much effective in terms of battery life, respecting the old/standard one...... but i wait for some users more skilled than me that could explain and reassure me....:laugh:
Click to expand...
Click to collapse
- high priority GCM push notifications will display immediately with shallow hibernation or w/Xposed option (Android 6.x and below)
- standard notifications will be delayed until next maintenance window with shallow hibernation; Xposed variant will deliver those immediately
- app developer controls notification priority
- personally I would stick with standard doze/hibernation and call it a day

sorry but i didn't understand your last point. what does it mean "call it a day"?? sorry i'm not a native english....
But seems that you don't rely so much on the new shallow mode.... is there a more precise technical motivation that you could bring on the discussion table... to let me understand why do you prefer the old hibernation method?

realista87 said:
sorry but i didn't understand your last point. what does it mean "call it a day"?? sorry i'm not a native english....
But seems that you don't rely so much on the new shallow mode.... is there a more precise technical motivation that you could bring on the discussion table... to let me understand why do you prefer the old hibernation method?
Click to expand...
Click to collapse
- expression "call it a day" simply means stop further activity (the job is done)
- I do not use shallow/aggressive hibernation as the benefits do not outweigh the side effects; all my devices sleep well with standard doze/hibernation

ok... in fact i notice that with shallow method some apps still continue to wake up the phone, i see the wakelocks on wakelock detector app and betterbatterystats. so at the end it's not clear if shallow hibernation is a REAL OR NOT hibernation... because these 2 apps that wake up, antutu and MYwind ( an app to check balance and options of my operator) are NOT setted to receive any notification... so i don't understand why they still uses alarms.
BUT........ i will continue to use shallow thinking and hoping that i could gain more battery life greenifying MORE APPS.... also the messaging ones. in fact i greenified telegram, WA, alsmost everything and i stil continue to receive notifications.
what i'm saying is that maybe standard hibernation is STRONGER, but it needs to be whitelisted with at least messaging apps and other apps used on average, and my fear is that the benefit gained from the TRUE "old" hibernation could be not surpassed by the smallest NOT whitelisted apps that the shallow ones permits you to set....without break any notification (sorry i'm not a native english, it's my best)

realista87 said:
ok... in fact i notice that with shallow method some apps still continue to wake up the phone, i see the wakelocks on wakelock detector app and betterbatterystats. so at the end it's not clear if shallow hibernation is a REAL OR NOT hibernation... because these 2 apps that wake up, antutu and MYwind ( an app to check balance and options of my operator) are NOT setted to receive any notification... so i don't understand why they still uses alarms.
BUT........ i will continue to use shallow thinking and hoping that i could gain more battery life greenifying MORE APPS.... also the messaging ones. in fact i greenified telegram, WA, alsmost everything and i stil continue to receive notifications.
what i'm saying is that maybe standard hibernation is STRONGER, but it needs to be whitelisted with at least messaging apps and other apps used on average, and my fear is that the benefit gained from the TRUE "old" hibernation could be not surpassed by the smallest NOT whitelisted apps that the shallow ones permits you to set....without break any notification (sorry i'm not a native english, it's my best)
Click to expand...
Click to collapse
I understand what you are saying. Best path is to test both modes to determine which best meets your needs. Good luck.

Related

setandallowwhileidle() checking notification push w/ greenify

Hello @oasisfeng
Ive been using of greenify since the beggining ive rooted my device and now that MM is out which im also using since it was released on my nexus 5 device i still used greenify
Right now i have to uninstall it for one particular reason. It doesnt sync in notifications anymore.
I do know that "doze" limits notifications but opens background sync up in a short time for every minute or hours of interval. I do know greenify forces apps to go to "app standby" mode or forces apps to defer background process without exiting them on 6.0+ this means that the general "wait time" for push notifications are also deffered.
I do know there is a "wake up service" for greenify that intends to wake up device services again when hibernated from time to time but to be honest i think it is inefficient.
So haveyou tried creating an alarm that cuts the hibernation off for a small second to quickly sync in background process and push notifications from apps such as xda labs or messenger? You can do it by creating an alarm with a code of setandallowwhileidle()
Hope you read this and ill be waiting for your feedback, in the meantime ill be uninstalling greenify also its donate package and wait for further improvements
Cheers!
Instant messaging apps should generally be excluded from Greenify unless it supports GCM "high priority" push on Android 6.0+. This is the recommended solution mentioned in the app description and FAQ.
Do you mean the Greenify did sync in notifications in the past but not now? Can you give me a specific version number of Greenify that worked for you?
If I understand correctly, you want to wake-up apps periodically. It has been discussed actively in the early time. That derived a large set of functionality requirements, such as interval settings, settings per app, black-out duration, conditional wake-up, and etc. Even the worse, the longer interval, the less timely notification while the shorter interval, the more battery consumption. It is hard to balance, compared to the real right solution - GCM push. In summary, this idea introduced too much complexity.
As always, if you want to achieve that purpose, I'd suggest using Tasker together with the "wake-up" plug-in function provided by Greenify. Why do you think it is inefficient?
BTW, the solution of setAndAllowWhileIdle() is not the answer you may expect. If you are a developer and have read the documents, you should know this API is strictly limited and it also defeats the purpose of Greenify.
oasisfeng said:
Instant messaging apps should generally be excluded from Greenify unless it supports GCM "high priority" push on Android 6.0+. This is the recommended solution mentioned in the app description and FAQ.
Do you mean the Greenify did sync in notifications in the past but not now? Can you give me a specific version number of Greenify that worked for you?
If I understand correctly, you want to wake-up apps periodically. It has been discussed actively in the early time. That derived a large set of functionality requirements, such as interval settings, settings per app, black-out duration, conditional wake-up, and etc. Even the worse, the longer interval, the less timely notification while the shorter interval, the more battery consumption. It is hard to balance, compared to the real right solution - GCM push. In summary, this idea introduced too much complexity.
As always, if you want to achieve that purpose, I'd suggest using Tasker together with the "wake-up" plug-in function provided by Greenify. Why do you think it is inefficient?
BTW, the solution of setAndAllowWhileIdle() is not the answer you may expect. If you are a developer and have read the documents, you should know this API is strictly limited and it also defeats the purpose of Greenify.
Click to expand...
Click to collapse
I havent tried testing whileidle() to be honest i just read it multiple times on google sources and the likes.
For your suggestion on tasker i would not recommend it. There has been an endless discussion on tasker if it was battery friendly or not and i know for a fact that it is not. The problem with tasker is its constant background monitoring which depends on your "trigger" and "event" so yep i wouldnt use tasker to automate things anytime soon.
And yes. Waking up apps periodically is the thing that i would like to propose though it might contradict M's doze mode. So overall just now im with you that its not a good solution for messaging apps.
I dont remember it was years ago way back when im using kitkat and a non-famous brand phone locally made here in our country, but as far as i remember messenger really still doesnt tickle a notification update.
So bottomline right now theres no solution for messaging apps other than leaving it as it is right? The problem is that those messaging apps have the highest background drain so i guess i had to adjust myself using messenger lol
phantom146 said:
I havent tried testing whileidle() to be honest i just read it multiple times on google sources and the likes.
For your suggestion on tasker i would not recommend it. There has been an endless discussion on tasker if it was battery friendly or not and i know for a fact that it is not. The problem with tasker is its constant background monitoring which depends on your "trigger" and "event" so yep i wouldnt use tasker to automate things anytime soon.
And yes. Waking up apps periodically is the thing that i would like to propose though it might contradict M's doze mode. So overall just now im with you that its not a good solution for messaging apps.
I dont remember it was years ago way back when im using kitkat and a non-famous brand phone locally made here in our country, but as far as i remember messenger really still doesnt tickle a notification update.
So bottomline right now theres no solution for messaging apps other than leaving it as it is right? The problem is that those messaging apps have the highest background drain so i guess i had to adjust myself using messenger lol
Click to expand...
Click to collapse
IM app without GCM push is such a pain, since it usually tries its best to improve the real-time notifications, at the cost of power consumption. In my experience, even a 5 minutes interval wake-up is far from enough for a IM app, but already increases the power consumption a bit.
oasisfeng said:
IM app without GCM push is such a pain, since it usually tries its best to improve the real-time notifications, at the cost of power consumption. In my experience, even a 5 minutes interval wake-up is far from enough for a IM app, but already increases the power consumption a bit.
Click to expand...
Click to collapse
Agreed and again facebook and messenger is to blame for the poorly written codes and the messy services they all have.
Right now my issue is solved and im glad for such a quick and concise response. Ill be waiting for the future beta releases and in the meantime if you need my help for an upcoming feature on M count me in, and ill also throw down "possible suggestions" for you and maybe give you some codes for it
Cheers bud

GCM issues, how the big guys do it, and then greenify

Hello once again @oasisfeng
Again, after reading lots of things from linux documentary and guides from different android websites i have found out something peculiar about GCM.
according to an unnamed developer "GCM is not reliable"
The big question is why?
Gcm as stated by a lot of developers have several issues that are pretty alarming. Some of it is regarding service error which greenify doesn't play with. What our concern is the reliability of notification using GCM.
If you are looking at wakelocks or you happen to have amplify installed, you probably have already seen an alarm with the name mcs_heartbeat. This alarm is responsible for pushing notifications and broadcast To various apps that needs a gcm tickle. So mcs_heartbeat usually has 28 mins idle time before syncing. The real problem comes when a 3rd party app or something like the data connection fauled or blocked the mcs_heartbeat. This will trigger gcm_reconnect and other gcm alarms/wakelocks to restore and retreive the lost informations.
Now with this unreliable push what did the big guys do? Facebook and messenger created their own sync broadcast such as mqttlite. This creates a big problem for greenify because greenify only gets tickles from gcm and not a 3rd party notification receiver.
Now just asking, if this is really true, i have read that mqttlite is only responsinle for the "waiting" of messages for facebook together with messenger's mqttlite. However, there is also a messaging service for both the apps. So what part of GCM does facebook and messenger have? Does it really have one? And whats the role for mqttlite if fb indeed used gcm?
Thanks in advance
The reliability of GCM is mostly decided by your network (carrier), not the device or software. As far as I know, some carriers set a short timeout of data connection over mobile network, far less than 28 minutes. But as a side effect, if your device is not kept idle (in sleep), GCM will reconnect more frequently, forming a false appearance that "the reliability of GCM is interfered by some apps on my device". If the GCM on your device *is* reliable once a while, it is probably *caused* by those wakelocks hold by battery-hungry apps. That's why some users will notice much worse GCM reliability when Greenify keeps their device in sleep. They accuse Greenify for destroying their GCM experience.
This issue cannot be solved easily. That's why many apps choose to implement their own push solution. This in turn eats your battery much faster, because if many apps in your device are maintaining their own persistent connections to different servers, all with their own heartbeat wakelocks. Actually most of them do not have the proper profession on the battery saving within their own push solutions. As a result, the CPU and baseband on your device have to work almost constantly.
For the GCM purpose in the Facebook apps, I'm afraid you need to ask their developers.
If only my telecom carriers would give the free data to other facebook like apps i would gladly change to them(like metal, tinfoil etc.) Unfortunately this isnt going to happen.. And facebook is as bad as a malware in terms of all its services.. Reaching the devs wont do any good too..
Btw great update, fixed everything and its way beyond what i expected thx for the continued awesome work
Well, I can almost guarantee if they didn't use GCM they will now. Without GCM they won't be able to trigger a wakelock to get through Doze. Although this might stay the way it is, but something in me says people will rage by the millions that they aren't getting their facebook messages... I also believe that WhatsApp doesn't use GCM either. I haven't experimented enough with M to see if these are effected and I don't even use WhatsApp.
oasisfeng said:
This issue cannot be solved easily. That's why many apps choose to implement their own push solution. This in turn eats your battery much faster, because if many apps in your device are maintaining their own persistent connections to different servers, all with their own heartbeat wakelocks. Actually most of them do not have the proper profession on the battery saving within their own push solutions. As a result, the CPU and baseband on your device have to work almost constantly.
Click to expand...
Click to collapse
To add to this,. There are other push services available that provide a service close to what GCM provides and uses one service to communicate through (multiple apps through one service). One that I have been involved with is OwnPush (link below). This works almost the same as GCM, however is focused on end to end encryption and using as little battery as possible (Long idle times ect.)
http://forum.xda-developers.com/android/apps-games/future-push-services-ownpush-t3306763
Also from what iv seen its hard to get a good idea of how much power GCM uses, as its bundled with other Google services. But Google do white-list their services from Doze mode in M from the get-go to allow their services to maintain wake-locks and alarms for heartbeat ect.
Apache14 said:
To add to this,. There are other push services available that provide a service close to what GCM provides and uses one service to communicate through (multiple apps through one service). One that I have been involved with is OwnPush (link below). This works almost the same as GCM, however is focused on end to end encryption and using as little battery as possible (Long idle times ect.)
http://forum.xda-developers.com/android/apps-games/future-push-services-ownpush-t3306763
Also from what iv seen its hard to get a good idea of how much power GCM uses, as its bundled with other Google services. But Google do white-list their services from Doze mode in M from the get-go to allow their services to maintain wake-locks and alarms for heartbeat ect.
Click to expand...
Click to collapse
Most app devs dont use gcm because again, its inconsistent. Even though one follows google's standard, gcm relies on heartbeat and push interval which besides being unreliable can also be limited by some apps like amplify.
Feng would have a really hard time dealing with this notifications because there about a 100 different services associated with it. However, if one can find one receiver broadcast or a certain service associated with all those "different" push notifications that would be a big help

About notifications and hibernated apps

Hi all, I'm considering on buying the donation package of Greenify to try out the GCM Push notifications on hibernated apps but I´m not sure about it so can you please guys tell me if it's works properly and if it has any impact on the battery life?
Also, I would like to ask about the feature called "Shallow Hibernation" because I don't know what's exactly it does and the description doesn't tells much for me.
Thanks
Mr.YatekomoSan said:
Hi all, I'm considering on buying the donation package of Greenify to try out the GCM Push notifications on hibernated apps but I´m not sure about it so can you please guys tell me if it's works properly and if it has any impact on the battery life?
Also, I would like to ask about the feature called "Shallow Hibernation" because I don't know what's exactly it does and the description doesn't tells much for me.
Thanks
Click to expand...
Click to collapse
GCM Push notifications will work OK if the apps pushing notifications are developed keeping in mind Google's recommendations. Further for apps not using GCM viz. Facebook and WhatsApp etc it will have no effect.
On shallow hibernation: Till now, if you restart a hibernated app, it will have to start from the beginning and not from the background (like from 'recents'). This will consume more battery and that is why the Dev advised not to hibernate frequently used apps.
Now in shallow hibernation, the app will be kept in memory but it will not be allowed to function in the background (like syncing etc). When this app is opened again, it will start as if from 'recents' and not from the beginning. This will save more battery. This is my understanding but I don't know if I am 100% correct.
Mr.Jay said:
Admin Note: This is a special Q&A-formatted thread. Please follow this link to view it in your browser:
Click to expand...
Click to collapse
Where da link doe ??

HUGE background wakeup time

Hi!
Ok, I'm attaching 2 screenshots where the hibernated list shows an excessively big amount of wakeup time. If I understand correctly, the apps in this list are apps that are to be hibernatized later on since they were awaken by a service or another app, and the timers correspond to the total amount of time that said apps have been awaken in the background. Am I wrong? If so, please let me know.
atomomega said:
Hi!
Ok, I'm attaching 2 screenshots where the hibernated list shows an excessively big amount of wakeup time. If I understand correctly, the apps in this list are apps that are to be hibernatized later on since they were awaken by a service or another app, and the timers correspond to the total amount of time that said apps have been awaken in the background. Am I wrong? If so, please let me know.
Click to expand...
Click to collapse
If I understand correctly, you have chosen these apps for hibernation but they are not being hibernated.
Which version of Greenify are you running and in which mode? Do you have the donation pack and Xposed? Have you enabled Greenify in Device Administrator?
IIRC, you don't need to enable Greenify in Device Administrator. Isn't that to just allow hibernating from a shortcut on the screen?
No. It is for immediate screen off after auto hibernation, as per the description. But I have noticed that not enabling it sometimes interferes with hibernation itself.
Thank you @tnsmani and sorry for the delay in my reply. I'm using latest stable 2.8 I think? In Boost Mode, with Xposed enabled and donation package. I wasn't aware of the Device Adminitrator component, but I just enabled it. Will see how it goes.
And disable 'shallow hibernation' in Greenify if you have such an option in your version.
Yes, I do. I had disbaled that one or two days after it was first introduced. For some reason I felt Shallow Hibernation is less effective, at least my battery didn't seem to last the same vs normal hibernation.

Shallow hibernation bug (apps remain offline)?

I use Greenify with shallow hibernation.
I noticed that various apps like Facebook, Messenger, Whatsapp and Tapatalk sometimes are offline when I try to use (to refresh a page, to check a status or a message, etc.). After minutes and casually they return online. I'm sure that it is not a connection problem, and if I substitute shallow hibernation with normal hibernation this problem does not exists. So I think that it is a shallow hibernation bug. This happens with all the last versions of Greenify, beta and stable.
Do you have any feedback?
My system is a rooted Samsung Galaxy S5 stock 6.0.1.
rogxd said:
I use Greenify with shallow hibernation.
I noticed that various apps like Facebook, Messenger, Whatsapp and Tapatalk sometimes are offline when I try to use (to refresh a page, to check a status or a message, etc.). After minutes and casually they return online. I'm sure that it is not a connection problem, and if I substitute shallow hibernation with normal hibernation this problem does not exists. So I think that it is a shallow hibernation bug. This happens with all the last versions of Greenify, beta and stable.
Do you have any feedback?
My system is a rooted Samsung Galaxy S5 stock 6.0.1.
Click to expand...
Click to collapse
I experience something similar with Youtube, Maps and Firefox which i greenified: sometimes, when i resume them from hibernation, they can't go online. The connection is ok and other apps can connect but not those ones. Try to hibernate them again manually with the greenify button, then reopen them and see if they can connect.
Did you also disable any broadcast receiver for the problematic apps?
Are you still experiencing this problem after one year?
i'm on a sony stock 6.0.1 rom
Real question why use shallow hibernation? What problem/behavior are you attempting to address? Although native to Android 6+ it seems this mode is automatically utilized by normal/regular/standard doze as needed. I don't see a benefit to using it globally but obviously individual situations vary.
Additional background: https://greenify.uservoice.com/knowledgebase/articles/828357
Davey126 said:
Real question why use shallow hibernation? What problem/behavior are you attempting to address? Although native to Android 6+ it seems this mode is automatically utilized by normal/regular/standard doze as needed. I don't see a benefit to using it globally but obviously individual situations vary.
Additional background: https://greenify.uservoice.com/knowledgebase/articles/828357
Click to expand...
Click to collapse
I'm answering this a month later but would like to point out that for me Shallow Hibernation is amazing.
I have a device with plenty of memory for my usage, so I don't need the app to be wiped out of memory every time, just to be set as inactive.
For example, I found that Spotify is a great candidate for Shallow Hibernation.
Whenever I'm listening music on my computer, my phone has a tendency to stay awake because of Spotify Connect.
However if I shallow hibernate it, it won't keep the phone awake but still be kept in memory for me to use whenever I want. The same things goes for Maps, Youtube, and some games.
I’ve put an “Hibernate and Sleep” shortcut at homescreen and works really great.

Categories

Resources