FORUMS
Remove All Ads from XDA

[MAGISK 16][Battery Saver][6.0+] ENABLE DOZE on Google Play Services

3,209 posts
Thanks Meter: 2,136
 
Post Reply Email Thread
Hi guys,

I actually made this module for my personal own use, but who knows, someone here might find it useful as well.

UPDATE NOTES :
OOS Nougat & Oreo User might not be able to find system app on Battery Optimisation list, you can work around this by using 3rd party app like Greenify or Naptime to open Doze Whitelist, you will see Google Play Services already listed as "Optimised App". Or go to App Info from setting, choose "Battery" and scroll down to "Battery Optimisation" - if the module work, it should written "Optimising Battery Use"

OREO User, PLEASE USE OREO version. v6 Update is already in the Magisk Repo.

BACKGROUND :
I always find that Google Play Services is way too aggresive in doing its activities in the background. And its no secret that this main services from google is oftenly one of the main culprit for the sub par battery performance on most stock or even custom ROM across devices.

THE IDEA & THE BARRIER :
Starting in Android 6.0, Google has introduced one of my favorite features in battery saving : DOZE (quick read about this Here), it help us to make apps go into a "shallow" hibernation state. Where it use less energy but retain it's functionality.

Thing is, this feature is NOT applicable for Google Play Services. Thus, it cant help you to save the battery from being eaten by Google Play Services. And this is not for no reason of course (read SIDE EFFECT/NOTE section bellow for further explanation)

THE SOLUTION :
Quick study (if you are interested, one of the discussion can be found Here) reveal that Google put simple configuration is /system/etc/sysconfig/google.xml that WHITELISTING Google Play Services from the DOZE Mechanism.

So to make DOZE able to work on it, we simply need to remove the whitelisting.

This is WHAT THIS MODULE DO - SYSTEMLESSLY (obviously)

By installing this module, you can move Google Play Services from the "App Not Optimised" list to "App Optimised" which mean DOZE mechanism will work its magic on Google Play Services, thus should saving you more juices/batt throughout the day.

THE SIDE EFFECT/NOTE :
Saving energy never come without side effect. Same goes with this method.

By enabling Doze on Google Play Services, it will theoritically delay/pause some it's services. Most noticeable might be the GCM (cloud messaging) services.

App that use this services might experience delay in notification when Doze already kick in.

Although, in my experience (i use this mod on all of my three devices) my notif for LINE, WhatsApp and Telegram (my main comm app) is never been delayed. ( I put all these apps in my whitelist btw)

The one i noticed had slight delay is GMail. But i check my mail regularly throughout the day, so i need no real time notif for that.

As for all other main services like Accounts, Alarm, Location and elses, i never have any issue with them when i got this module active. GPS work fine, Alarm ringing, Account Syncing normally.


HOW TO INSTALL :
SO if after reading all the PROs and the probable CONs above , you still interested in trying this mod,

Simply dowmload it from the attachment, and install it through your MAGISK MANAGER. And reboot.

After reboot, go to "Setting" - "Battery" - tap the tri-dot menu on the top right and choose "Battery Optimisation"

Choose "All Apps" and switch ON the toggle for Google Play Services (in most ROM, it will be automatically switched to ON once this mod is installed)

ENJOY THEN !

Addendum :

WHAT IS THE DIFFERENCE between (+) and standard module ?
• Plus (+) version modified by @VR25 has an extra feature, which removing Google Play Services from Background Data Access Whitelisting. Thus enabling data saver or restricting background data will impact Google Play Services as well. This might save you extra juice, but BEWARE for interrupted background data activities.

Choose the one suit you most.

COMPATIBILITY :
This Mod should compatible with any Marshmallow and Nougat ROM (Official & Custom) that has Google Play Services Installed on it,

Tested on :
OOS, LOS, CM13, MIUI, EMUI, and TouchWiz

If you found that this module causing issue for your set up, simply uninstall it from magisk manager, or use the TWRP Uninstaller.

Screenshot of expected level of Google Play Services Battery Usage :

The Following 261 Users Say Thank You to otonieru For This Useful Post: [ View ] Gift otonieru Ad-Free
 
 
19th May 2017, 12:57 AM |#2  
psychoela's Avatar
Senior Member
Thanks Meter: 118
 
More
Simple and work fine with RR rom, Thanks

Sent from my Nexus 6 using XDA Labs
The Following 2 Users Say Thank You to psychoela For This Useful Post: [ View ] Gift psychoela Ad-Free
19th May 2017, 08:05 AM |#3  
Senior Member
Thanks Meter: 811
 
More
Htc 10 on viper rom. This breaks fingerprint sensor/home button for me
The Following User Says Thank You to JohnFawkes For This Useful Post: [ View ] Gift JohnFawkes Ad-Free
19th May 2017, 08:44 AM |#4  
OP Senior Member
Flag Djakarta
Thanks Meter: 2,136
 
Donate to Me
More
Quote:
Originally Posted by JohnFawkes

Htc 10 on viper rom. This breaks fingerprint sensor/home button for me

Thats weird,

My S8, OP3 and P9 all has fingerprint scanner, and work normal.

Can you try,

Before placing finger on the scanner, turn on your screen first by pressing lock button,

If it managed to scan, then it means it doesn't actually break FP, it just the phone go to deeper sleep (since GMS is now hibernated as well) and refuse to wake up simply by placing finger.

But if it atill refuse to scan even with screen on. Send me a logcat
19th May 2017, 09:45 AM |#5  
Senior Member
Thanks Meter: 811
 
More
Quote:
Originally Posted by otonieru

Thats weird,

My S8, OP3 and P9 all has fingerprint scanner, and work normal.

Can you try,

Before placing finger on the scanner, turn on your screen first by pressing lock button,

If it managed to scan, then it means it doesn't actually break FP, it just the phone go to deeper sleep (since GMS is now hibernated as well) and refuse to wake up simply by placing finger.

But if it atill refuse to scan even with screen on. Send me a logcat

I don't have any FPs set up but waking screen and using it as a home button does not work and I get no vibration either even though it's set to 90 in exkm
edit give me a few minutes to reinstall and I'll get a logcat for you
19th May 2017, 09:52 AM |#6  
Senior Member
Stockholm
Thanks Meter: 116
 
More
Works great on my nexus 6p, thank you!

Sent from my Nexus 6P using Tapatalk
The Following 2 Users Say Thank You to Kimbo82 For This Useful Post: [ View ] Gift Kimbo82 Ad-Free
19th May 2017, 10:06 AM |#7  
Senior Member
Thanks Meter: 811
 
More
so after flashing this time I lost root and no cell serviceafter reboot. Looked at your module.prop and from my understanding with v12 modules are supposed to use versioncode 3 not 1. So I changed it 3 and zipped it back up. Booted into twrp used magiskmount to delete this module and flashed the one with 3 as versioncode and after booting up I have root and cell service and my home button is working like it should.
The Following 4 Users Say Thank You to JohnFawkes For This Useful Post: [ View ] Gift JohnFawkes Ad-Free
19th May 2017, 11:01 AM |#8  
OP Senior Member
Flag Djakarta
Thanks Meter: 2,136
 
Donate to Me
More
Quote:
Originally Posted by JohnFawkes

so after flashing this time I lost root and no cell serviceafter reboot. Looked at your module.prop and from my understanding with v12 modules are supposed to use versioncode 3 not 1. So I changed it 3 and zipped it back up. Booted into twrp used magiskmount to delete this module and flashed the one with 3 as versioncode and after booting up I have root and cell service and my home button is working like it should.

Crap, so that's where the issue belong,

although am using v1 myself on v12 Magisk, since it's supposed to have backward compatibility. And so far there's no issue.

I think ROM combination might have something to do as well,

but as for now i'll update the installer zip.

Thx for the debug!
The Following 7 Users Say Thank You to otonieru For This Useful Post: [ View ] Gift otonieru Ad-Free
19th May 2017, 12:09 PM |#9  
Senior Member
Thanks Meter: 811
 
More
Quote:
Originally Posted by otonieru

Crap, so that's where the issue belong,

although am using v1 myself on v12 Magisk, since it's supposed to have backward compatibility. And so far there's no issue.

I think ROM combination might have something to do as well,

but as for now i'll update the installer zip.

Thx for the debug!

No problem! Happy to help. If you need a tester for anything just let me know
19th May 2017, 01:20 PM |#10  
Rom's Avatar
Senior Member
Flag Lyon
Thanks Meter: 1,006
 
Donate to Me
More
Works successfull, thanks for works
The Following 3 Users Say Thank You to Rom For This Useful Post: [ View ] Gift Rom Ad-Free
19th May 2017, 05:58 PM |#11  
asusgarb's Avatar
Senior Member
Thanks Meter: 308
 
More
Hi. I tried installing it. Installation worked and module appeared in the list, but on reboot it disappear. I'm on Galaxy Note 3 with custom kernel and custom magisk. I've asked if it could be that magisk's problem, but maybe could be this module fault?
My rom is Unofficial LineageOS 7.1.2.

P.S. I also tried flashing it with TWRP without success. I'll try this module in my tablet to check too (Lineage 7.1.2 too).

Inviato dal mio SM-P605 utilizzando Tapatalk
Post Reply Subscribe to Thread

Guest Quick Reply (no urls or BBcode)
Message:
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes