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

Search This thread

nikolai7

Senior Member
Feb 16, 2016
80
7
tried in lineage 16 (android 9), using magisk v20 and the first zip (magisk v19 and pie) but doesnt seem to work. it lets me select optimization for google play services, but when i tap on it and accept, it wont change it and it remains in not optimized.
 

Kovhl

Member
Jan 21, 2019
46
6
Tried this module since universal GMS doze switches off everything except calls.

This module made Google play services optimized in battery section ( althought I didn't do it manually , neither I cud change to not optimized )

This module have reenabled the os to disable google
Play services.. surprise.

I diabled that and all other googel apps. And restricted baground battery for these hyenas ( just in case)

[ What's app won't receive messages (why the hell it is routed through Google play services to receive push notifications I don't know) when phone sleeps idle. .but that's ok ... I will consider switcing to lineage OS. ]

Am on OnePlus 6T 9.0.16 Magisk stock kernel.

Noticeable changes :

Usually I get 6.5 to 7 hrs screen on time.
Now 10 hrs.

I can afford to check wahtsapp once in a while in exchange I get 3 hrs extra battery life .


Thanks dev ? ?

Any other advice as to how to improve... Am all eager ears dev.
And also , any ways to make WhatsApp receive push notifications without Google play services and google maps to work without it ??
I have to enable play services if I need to use maps.
 

Attachments

  • Screenshot_20191109-200427.png
    Screenshot_20191109-200427.png
    97.7 KB · Views: 678
  • Screenshot_20191109-200452.png
    Screenshot_20191109-200452.png
    132.1 KB · Views: 680
Last edited:

Ulf3000

Senior Member
Aug 7, 2014
100
10
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.

------------------------------------------------------------------------------------------------------------------------------

edited this file manually and also disabled all the samsung **** in that folder too
 

DaveedDB

Senior Member
Nov 11, 2013
1,111
472
Bridgetown
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.

------------------------------------------------------------------------------------------------------------------------------

edited this file manually and also disabled all the samsung **** in that folder too
That's what this module used to do ,but Google and most of the new phones mostly Chinese have other persistent apps that stop the phone from dozing quickly, even whatsapp has a stupid wakelocks that links with gms that's why some people receive delayed msgs etc ,also the devs are trying to provide this for various devices ,which is challenging one device it might work and another it won't, hell even the same device one running nougat and one pie or Q they might not work either
 

Beatz106

Senior Member
Jul 25, 2018
181
41
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.

------------------------------------------------------------------------------------------------------------------------------

edited this file manually and also disabled all the samsung **** in that folder too
How this works because this module isn't working on Pie (LineageOS)
 

Ulf3000

Senior Member
Aug 7, 2014
100
10
How this works because this module isn't working on Pie (LineageOS)

you take a root capable explorer (im using total commander) and then edit the files with a text editor(total commander has that build in) . refer to the 1st post in this thread!

but i reverted the google play services becasue of google maps which would give me problems then...

now i completely disabled doze and installed an old xposed module deep sleep battery saver . it might be specific to my phone (samsung s7 oreo) but i get better idle battery usage that way and all apps still work normally (unlike with doze)...
 
  • Like
Reactions: Beatz106

Spartacus500

Senior Member
Nov 6, 2014
541
98
Works for someone on Samsung Galaxy S7 / S8 / S9 etc. android 9.0 Pie? I tried at home on Samsung S7 9.0 Pie, after the first reboot, the phone hung on the text samsung and suddenly a black screen ... I managed to enter the downloaded mode and after rebooting the phone started, but you can not move the slider to optimize google gms 🤔
 

Top Liked Posts

  • There are no posts matching your filters.
  • 269
    Hi guys,

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

    PIE & Magisk v19 Compatible Update
    https://drive.google.com/file/d/1-Nw6xHIhOPz06j4FqD-geAnMCz2NzPKX/view?usp=drivesdk

    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 ! :highfive:

    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 :

    Screenshot_20170623_020158.png
    Screenshot_20170623_020705.png
    16
    Here's a new goodie:

    Sysconfig Patcher

    Systemlessly patches "/system/etc/sysconfig/*" for data and battery savings & auto-re-patches after ROM/GApps updates.

    This one does the same as "DozeGMS" or similar module/tweak, but... in addition to "google.xml," it also patches ALL the remaining XML files in /system/etc/sysconfig, systemlessly! Therefore it's not limited to GApps. The other system apps listed there are also removed from the power & data whitelists.

    This way, no app will ever have unrestricted access to data & power intensive resources without the user's explicit consent.

    Note: this may not be for everyone. While some mention things such as downloads stopping on screen off & whatnot, I've never came across such an issue. Test for yourself, take your own conclusions & be responsible for any nuclear disaster(s) and/or cat harm potentially triggered by the use/misuse of this module.
    14
    Nope not the same, someone seems to have tried to copy him and made a module that doesn't even work
    @otonieru might wanna publish your module to the Magisk repo since someone else put an inferior module copying yours there

    Thx @demonoidmaster for the head up,
    @simonsmh is a fellow member here at xda as well,

    I dont think he actually copy my module,

    I believe he create another module using regex logic, so that he wont need to replace the whole google.xml

    He used to put comment(s) in this thread as well about that,

    My reason why i didnt move to using regex is because it has bigger risk of module not working,

    Most of ROM which using Gapps will still use google standards in placing the config in the respective .xml thus my module will work in like 8 out of 10 situations,

    Am not sure about the success rate of using regex method, (used to try it, but decide to revert)

    After all, we are just two dev(s) trying to achieve same goal, only using different path

    I think Simon surely already test his module prior to released as well (on his OP3 i guess?)

    But unfortunately it wont work on OP5 ?

    Thank you for advising me to put the module up to repo,

    I'll try to do that, (not soon enough maybe) i dont have much time on my pc lately. Most of my recent xda activities were done in a brief time through phone.

    Also for everyone who still use Magisk v12, the compatible v3 module is avail page back,

    I advising you to either keep the file yourself after download, or upgrading to v13.3 altogether,

    i'll only maintain the latest module which using latest template, else it can confusing in main post

    Thank you & salam from indonesia
    12
    Here you go:

    Original Oreo google.xml
    https://www.dropbox.com/s/k7q3g0rx9uyumza/google.xml?dl=0

    and I made the below Magisk module for myself but figured others might enjoy it :)

    EnableGMSDoze for Oreo
    https://www.dropbox.com/s/562drx7q1uenf57/EnableGMSDoze_Oreo_Magiskv15.zip?dl=0
    12
    But with the next version (13.3), all Magisk modules will not continue to work..

    @otonieru could you keep up to date your module please ?

    This has already been addressed: https://forum.xda-developers.com/showpost.php?p=72981906&postcount=227

    As of now the module still works fine.

    Module has been updated to latest template. tested on 13.2 and it work as it should as well

    v4 is available on main post.