Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: briandebottari/EnableGMSModuleMagisk
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: master
Choose a base ref
...
head repository: Magisk-Modules-Repo-CN/EnableGMSModuleMagisk
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
Able to merge. These branches can be automatically merged.
  • 4 commits
  • 2 files changed
  • 1 contributor

Commits on Sep 1, 2018

  1. Update module.prop

    TayLin99 authored Sep 1, 2018
    Copy the full SHA
    e5e856f View commit details
  2. Update README.md

    TayLin99 authored Sep 1, 2018
    Copy the full SHA
    0c2c88c View commit details

Commits on Sep 2, 2018

  1. Update README.md

    TayLin99 authored Sep 2, 2018
    Copy the full SHA
    b5cbb19 View commit details
  2. Update README.md

    TayLin99 authored Sep 2, 2018
    Copy the full SHA
    75b8672 View commit details
Showing with 57 additions and 45 deletions.
  1. +55 −43 README.md
  2. +2 −2 module.prop
98 changes: 55 additions & 43 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,52 +1,64 @@
## Brief Explanation
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](https://www.howtogeek.com/242563/how-androids-doze-improves-your-battery-life-and-how-to-tweak-it/)), 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 (detail, if you are interested [Here](https://android.stackexchange.com/questions/143247/how-to-make-google-play-services-and-other-default-white-listed-system-apps-doze))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.

OOS (OnePlus) user with Nougat version and above installed wont find this option anymore. Instead, they should go to "Google Play Services" App Info from setting, choose the battery option, and scroll down to "Battery Optimisation" to check the status

## 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.

## CHANGELOG
GMS = Google Play Services

## 简要说明

我发现GMS在后台时的活动过于激进。众所周知,过于活跃的GMS正是导致设备疯狂耗电的罪魁祸首。

## 想法 以及 实际情况

Google从Android 6.0开始,推出了 Doze ( [点击这里快速了解Doze](https://www.howtogeek.com/242563/how-androids-doze-improves-your-battery-life-and-how-to-tweak-it/))它有助于让应用进入潜度休眠状态,也就是我们常说的「打盹」。

应用进入「打盹」状态后,能在保持功能正常使用的情况下降低耗电量。

但问题是,GMS无法进去「打盹」。因此,它无法减少GMS的耗电量。当然Google这么设定也是有原因的(请阅读下方 注意事项 部分以进一步了解)

## 解决方案

快速了解(如果您有兴趣请点[这里](https://android.stackexchange.com/questions/143247/how-to-make-google-play-services-and-other-default-white-listed-system-apps-doze))

原理很简单,默认情况下你是无法在Doze列表看到GMS的。这个模块的作用就是将GMS从Doze的白名单显示出来。

接着,我们只需要将GMS从Doze白名单中移除,这样GMS就能够进入「打盹」状态。

这就是这个模块所做的所有事情,并且是Systemlessly。

通过本模块,您可以将GMS从“Doze白名单”列表移至“优化列表”中,使得GMS可以进入「打盹」状态以节省一部分耗电。

安装了Android7或更高版本的系统的 一加手机用户 无法找到此选项。但还是可以从设置中的“GMS”应用信息中,选择电池选项以检查优化状态。

## 注意事项

省电不会导致出现问题,这种方法也是如此。

通过在GMS开始「打盹」,正常情况下会导致GMS延迟或暂停某些服务。其中有一个我们能感知到的,就是GCM通知服务的延迟。

当设备已经处于「打盹」状态时,使用相关服务的部分应用程序会有一定的通知延迟。

但,根据我个人的情况来看(我在我的三个设备上都用了这个模块),我的LINE,WhatsApp和Telegram的通知一切正常。 (在我把这些应用放入白名单的前提下)

我注意到的那个稍有延迟的是Gmail。但是我个人习惯自行开邮箱查阅邮件,所以这个对我来说影响不大。

至于其他方面,例如 账户同步,铃声,位置服务以及其他的什么东西,都没有任何问题。

GPS工作正常,通知响铃正常,帐户同步正常。

## 更新日志
### v1.
-Initial Release
- 初发布
### v2.
-Template Update
- Magisk模板更新
### v3.
-Code Cleaning
- 代码精简
### v4.
-Template Update for Magisk 13.3
- Magisk模板更新至13.3
### v5.
-Template Update for Magisk 14 - PLEASE UPDATE YOUR MAGISK INSTALLATION
- Magisk模板更新至13.3 - 请更新你的 Magisk Manager
### v6.
-Template Update for Magisk 15 & Adding OREO Support
- Magisk模板更新至15 - 兼容Oreo

## Support
Find support on my thread @XDA : [Here](https://forum.xda-developers.com/apps/magisk/module-enable-doze-google-play-services-t3608783/post72344542#post72344542)
## 支持
你可以在 @XDA找到我的这个项目 : [点击这里跳转](https://forum.xda-developers.com/apps/magisk/module-enable-doze-google-play-services-t3608783/post72344542#post72344542)

## Copyright
## 版权所有
otonieru@xda-developers - 2018
If you wish to implement the modification into your ROM, please mention me :)
如果您希望该模块适配您使用的ROM,请告知于我 : )
4 changes: 2 additions & 2 deletions module.prop
Original file line number Diff line number Diff line change
@@ -2,6 +2,6 @@ id=dozegms
name=Enable Doze for GMS Magisk Module
version=v6
versionCode=6
author=otonieru @ xda-developers
description=Enable Dozing for Google Play Services without tampering with System
author=otonieru@xda-developers 汉化:TayLin@Coolapk
description=在不修改系统的情况下对Google Play服务启用Doze。
minMagisk=1500