EnforceDoze
1.10.2 · GitHub
More about this app
Enable Doze mode immediately after screen off and turn off motion sensing to get best battery life
EnforceDoze
EnforceDoze is a fork of ForceDoze which is not maintained anymore. Thanks to @theblixguy for all his work on this.
EnforceDoze allows you to forcefully enable Doze right after you turn off your screen, and on top of that, it also disables motion sensors so Doze stays active even if your device is not stationary while screen off. Doze will only deactivate periodically to execute maintenance jobs (like getting notifications, etc), otherwise it will remain active as long as your screen is off. This brings a lot more battery savings than standard Doze functionality, because even with screen off and Doze enabled, Doze is still periodically checking for movement, and disabling motion sensing improves battery life further.
Or download the latest APK from the Releases Section.
Enjoying Enforcedoze?
Please consider making a small donation to help fund the project. Developing an application, especially one that is open source and completely free, takes a lot of time and effort.
Coverage:
- LifeHacker: https://lifehacker.com/how-to-squeeze-more-battery-out-of-your-phone-with-andr-1791336715
Features
- Force Doze mode immediately after screen off or after a user specified delay
- Add/remove apps or packages directly to system Doze whitelist
- Disable motion sensors to prevent Doze from kicking in during movement
- Disable Biometrics in doze mode to further improve battery life
- Tasker support to turn on/off EnforceDoze and modify other features
- Disable WiFi and mobile data completely during Doze
- Enable Doze mode on devices where OEM has disabled it
- No root mode so you can enjoy the core benefits without rooting your device
- Free, no ads and open source
Here is a table of features
| Feature | Non Root | Root |
|---|---|---|
| Disable Wifi | Android < 29 | ✅ |
| Disable Mobile data | ❌ | ✅ |
| Disable Biometrics | ❌ | Depending on device |
| Disable Sensors | Depending on device | ✅ |
| Disable All sensors(equivalent to the dev tile) | ❌ | ✅ |
| Ignore disable with hotspot | ✅ | ✅ |
| Whitelist music app | ✅ | ✅ |
Permissions
android.permission.QUERY_ALL_PACKAGES: needed to select apps to dozeandroid.permission.ACCESS_NETWORK_STATE: used to detect hotspot state to not disable wifi/data if hostpot is enabledandroid.permission.READ_PHONE_STATE: to check if mobile data need to be disabled on Doze if configuredandroid.permission.ACCESS_WIFI_STATE: to check if WiFi needs to be disabled on Doze if configuredandroid.permission.CHANGE_WIFI_STATE: to disable WiFi on Doze if configured
Android
Requirements for compiling source code and running the app:
- Android 6.0 (Marshmallow) SDK platform
- Android smartphone running 6.0 (Marshmallow)
- Android Studio
- Root (can work with limited functionality in non-root mode)
License
This code is licensed under GPL v3
Having issues, suggestions and feedback?
You can,
Languages: 
The Translations are hosted by Weblate.org.
How Shizuku is used
Can force Doze mode, tune Doze timings, control sensors and radios, and suspend apps via Shizuku shell commands in `sh -c`.
This is an AI-assisted analysis of Shizuku-related usages in the app's public source code. It is best effort, so it may not catch every single usage.
How this app uses Shizuku
EnforceDoze uses Shizuku to run privileged shell commands that force and tune Android Doze mode and reduce battery use when the screen is off.
- Force Doze on and off: puts the device into deep idle immediately after screen off and exits it on wake using
dumpsys deviceidle force-idle,force-idle deep,unforceandstepcommands through Shizuku. - Tune Doze timings: applies custom Doze timing values chosen in the tunables screen with
settings put global device_idle_constantsanddevice_config put device_idlecommands through Shizuku. - Control motion sensors: disables motion sensing when Doze starts and re-enables it on exit with
dumpsys sensorservice restrictanddumpsys sensorservice enablethrough Shizuku, with an optional user chosen package left allowed. - Manage radios in Doze: turns mobile data, WiFi and Bluetooth off and on around Doze periods with
svc data,svc wifiandsvc bluetoothcommands through Shizuku. - Adjust power settings in Doze: toggles battery saver, airplane mode, biometrics and location mode during Doze with
settings putcommands and an airplane mode broadcast through Shizuku. - Suspend blocklisted apps: disables or suspends user selected apps when entering Doze and re-enables them on exit with
pm suspend,pm unsuspend,pm disableandpm enablethrough Shizuku. - Block app notifications: turns notifications off and on for user selected apps during Doze with a
service call notificationcommand through Shizuku. - Keep service in Doze whitelist: adds itself to the system Doze whitelist with
dumpsys deviceidle whitelistthrough Shizuku for reliable operation. - Self grant permissions: grants itself
DUMP,WRITE_SECURE_SETTINGSandREAD_PHONE_STATEwithpm grantthrough Shizuku so it can read idle state and apply settings.
Android APIs or commands used
pm grantdumpsys deviceidle force-idle deepdumpsys deviceidle force-idledumpsys deviceidle unforcedumpsys deviceidle stepdumpsys deviceidle whitelistdumpsys sensorservice restrictdumpsys sensorservice enabledumpsys activity activitiessettings put global device_idle_constantsdevice_config put device_idledevice_config resetsettings put global low_powersettings put global airplane_mode_onsettings put secure biometric_keyguard_enabledsettings put secure location_modesvc data enablesvc data disablesvc wifi enablesvc wifi disablesvc bluetooth enablesvc bluetooth disableam broadcast -a android.intent.action.AIRPLANE_MODEpm suspendpm unsuspendpm enablepm disableservice call notification
Notable details
Shizuku is an optional execution mode selected in settings; the same Doze, sensor, radio and app control actions are also available without Shizuku when the alternate backend is usable. On newer Android versions some tunables use per key device_config commands instead of the single device_idle_constants value.
Changelog
What's new for version 1.10.2
Features
- redesign About screen with Material3 cards and add sponsor support (https://github.com/Akylas/EnforceDoze/commit/5421cd68adedf639ced126546169ca6583c50309)
- add static landing page website in docs/ (https://github.com/Akylas/EnforceDoze/commit/5c03c6cc9233423f301c0b327dff034b28992b2c)
Bug fixes
- removed non root sensor workaround (https://github.com/Akylas/EnforceDoze/commit/0b6458b665318a1934749169cff7008834d8adfb)
- new icon (https://github.com/Akylas/EnforceDoze/commit/cfee86bfe64b41ab08f33121554578edbde9ea1c)
Code refactoring
- use Utils.openUrl() helper and replace heart emoji with vector drawable (https://github.com/Akylas/EnforceDoze/commit/166f2e1bd2d228f450dd25c1a2a2edbcbdc36b8c)
- Translations update by @albanobattistella, @hotmail, @Francisco, @gmail, @Deleted, @weblate
Permissions
17 permissions requested
Sources
2 sources
Sources
2 sources

