Greenify and GCM Push notification on MM - Greenify

@oasisfeng
I searched a bit and I kept finding conflicting info regarding the interaction between greenify and GCM-Push notifications on Android Marshmallow without xposed. From here the developer states that " GCM push should work for all hibernated apps once their developer adopt the new GCM priority policy required by Android 6.0. No more Xposed framework needed for GCM push!", however all over the google+ community and here at xda it is said that that option works only with xposed installed in fact it can't be enable without having xposed. Therefor is it implemented in the app inherently? or is it still a "project"?
I want only a clarification on this matter to better understand if i have to greenify the social apps or not (I need their notification even if not received ASAP).

You raise a good point. I'd like to know this as well. I had to disable GCM function because of constant random reboots. So far, since disabling, I've not had a reboot but time will tell.
Sent from my Nexus 6 using Tapatalk

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

Will I get notifications if using greenify in root only mode?

Hey, im using greenify on Android MM with xposed framework. I do get notified when receiving a message thanks to gcm feature (I think) that works with xposed only.
Wanted to know in case I'll use greenify with root only, will I get notifications from apps (such as whatsapp, Facebook etc) immediately or only when I'll enter the app?
I ask this since Im thinking about upgrading to Android n and since there isn't xposed framework yet I won't be able to use the xposed features of greenify.
Sent from my ONEPLUS A3000 using Tapatalk
You could test this yourself on your current phone by disabling Xposed Greenify module.

Notifications stopped for some apps

Not sure what's going on, but I thought it was related to hibernation and/or deep doze, but notifications aren't coming through for some of my apps. I still get notifications from chat apps like Hangouts, LINE, HelloTalk, Twitter, and Sync, but other apps like Groupon, Coffee Meets Bagel, no longer show me any notifications. I'm on a LGV20 running Nougat and the latest Greenify beta and have also tried to whitelist these apps from Dozing, but not dice. any suggestions?
I'm having the same issues on my Oneplus 3t.
dimm0k said:
Not sure what's going on, but I thought it was related to hibernation and/or deep doze, but notifications aren't coming through for some of my apps. I still get notifications from chat apps like Hangouts, LINE, HelloTalk, Twitter, and Sync, but other apps like Groupon, Coffee Meets Bagel, no longer show me any notifications. I'm on a LGV20 running Nougat and the latest Greenify beta and have also tried to whitelist these apps from Dozing, but not dice. any suggestions?
Click to expand...
Click to collapse
Eggstones said:
I'm having the same issues on my Oneplus 3t.
Click to expand...
Click to collapse
Similar posts in other Greenify threads although not everyone is seeing this. No definative solutions; what works for one doesn't for all. You'll need to do some searching to sort the issue.
looks like my problem for missing notifications were due to AdAway blocking some amazonaws.com hosts... I'm back on track now with Greenify working 100%. unfortunately I need to not Greenify GroupOn for it to show notifications =(

Does Greenify really work ?

On my Mate 9 (running Oreo 8.0, no root) I installed Greenify, but Greenify displays that e.g. Opera is greenified, but in an Android task manager (Android Assistant app) it shows it is still eating CPU. The same applies to e.g. Brave browser which has 'no background' according to Greenify.
Does Greenift really hibernate apps ?
mermaidkiller said:
On my Mate 9 (running Oreo 8.0, no root) I installed Greenify, but Greenify displays that e.g. Opera is greenified, but in an Android task manager (Android Assistant app) it shows it is still eating CPU. The same applies to e.g. Brave browser which has 'no background' according to Greenify.
Does Greenift really hibernate apps ?
Click to expand...
Click to collapse
Of course it does. The size/activity in this forum plus frequent mentions in respected publications over many years should offer some clues to its integrity. Whether it is working on your device is a different matter.
Greenify does best on rooted devices as unharnessed ROMs can both undo actions and/or misrepresent status. It's quite possible an app placed in hibernation was later woken via internal trigger that Greenify can not suppress on an unrooted device. In the case of Opera (my preferred browser) there is regular syncing of tabs and downloading of *cough* 'news' if you have those features enabled.
I also question info coming out of the "Android Assistant" app. On my device it claimed all apps had zero CPU...including itself. Also did not display system partitions correctly nor properly detect the sensor suite. Granted I only spent a few minutes poking around. Maybe some switches needed to be thrown.
Finally, you probably don't need Greenify on Oreo as Doze does a find job with power management.
planetera said:
Don't I really need Greenify on oreo? Is Doze on Oreo really that good? Can you confirm please? I've been always using Greenify but if I don't need it on Oreo, I'll remove it
Click to expand...
Click to collapse
Well don't take my word for it. Simply remove all apps from Greenify's hibernation list (hopefully there are not many there), observe device behavior over the next few days then make your own decision.
planetera said:
Well, thanks for information. Just made a quick research and everyone says Greenify is trash on Oreo. So I just uninstalled it. Thanks for heads up. Glad I've seen your comment
Click to expand...
Click to collapse
Trash? Err-no. I have it installed on every one of my devices for valid reasons. Needed for generic power management on Doze capable ROMs? Probably not (and as such serving no purpose). Enjoy your device.
planetera said:
ok, but, when Greenify hibernates an app, you don't get notificaton froms this app, but when Android itself hibernates the app, you still get notifications, how does these two compare?
Click to expand...
Click to collapse
It varies by app, developer approach and user settings. Many apps will experience delayed notifications with Doze while other punch right through. Greenify can be configured to permit notifications but only if the app utilizes GCM (Firebase). Aggressive doze, light hibernation, Xposed framework availability and several other variables contribute to notification behavior. If your head is spinning it should! End users should not need to know the contents of the underwear drawer. Best practice is to simply let Android do its thing without 3rd party tools unless one understands their behavior and application. At one time such tools were needed to achieve acceptable app/device performance and battery life. Not so today. Is such a simplistic solution 'optimal' form an enthusiasts point-of-view? Probably not. It is acceptable/reasonable from an end-user perspective? In most cases 'yes' yielding a good balance of performance and battery life with minimal interaction for those who simply want to enjoy their device vs. manage it. Good luck with whatever direction you choose.
Agree one hundred percent!
Greenify on Oreo is an appendage that is best left out in my opinion, since for most, Oreo itself manages the drain admirably. Though I have it installed, it is more by way of habit than necessity. I have experienced Oreo without Greenify and have no complaints.
Greenify is STILL works.
But its benefit on recent Android versions is not as prominent as on earlier versions.
Coz we already have Doze starting from Marshmallow.
It works for me. I have a samsung tab a 9.7 sm-t550 with an aicp 8.1 rom (lineageos based). Therefore it doesn't have the built-in samsung app device maintenance. I've also discovered a little trick to using greenify that I want to share. I use greenify with another app called shutapp. Shutapp is an app that helps you force stop apps running in the background. Except I don't do that. I use it solely for the purpose of having an accurate number of apps running in the background. Then I open the app to see which ones are running. Next I open greenify and hibernate them. I use this method, because I found that when you force stop the apps they will open back up again. Also, I use the widget from shutapp and not the floating bubble which requires extra permissions granted. The widget does the same thing without the extra permissions. This method I discovered has improved my ram and battery life drastically. I can tell because I use status bar mini pro to monitor my ram speed constantly. And finally I do have Xposed with the donation package of greenify, didn't want to leave that out. Not sure if it makes a difference or not, but wanted to be accurate. That's it, hope that works for somebody else, take care.
I hear that greenify isn't really needed on Oreo but how about the xposed version of greenify? That ads a couple of more features, does any of those change the verdict to "must have on Oreo" for greenify?
ovizii said:
I hear that greenify isn't really needed on Oreo but how about the xposed version of greenify? That ads a couple of more features, does any of those change the verdict to "must have on Oreo" for greenify?
Click to expand...
Click to collapse
The verdict doesn't change. Use of Greenify on Oreo may become "must" only if you have a rogue app which can't be controlled otherwise. Even then, it might be better to seek alternative apps instead of trying to control it with Greenify.
ovizii said:
I hear that greenify isn't really needed on Oreo but how about the xposed version of greenify? That ads a couple of more features, does any of those change the verdict to "must have on Oreo" for greenify?
Click to expand...
Click to collapse
tnsmani said:
The verdict doesn't change. Use of Greenify on Oreo may become "must" only if you have a rogue app which can't be controlled otherwise. Even then, it might be better to seek alternative apps instead of trying to control it with Greenify.
Click to expand...
Click to collapse
Greenify works just fine on recent Android builds. It is a tool that can be very beneficial when properly used to produce a specific outcome. That said, it is rarely needed on Android 6+ as doze handles most of the heavy lifting. Enjoy using your device vs trying to fix problems you haven't identified.

Categories

Resources