ShizuStore

EnforceDoze

Akylas

1.10.2 · GitHub

Download APK
Power management Android 6.0+ 5 months ago GPL-3.0
113 ShizuStore
24.1k GitHub
361 Stars
2 MB Size

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.

Get it on F-Droid Get it on IzzyOnDroid

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.

:heart: Sponsor

Coverage:

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 doze
  • android.permission.ACCESS_NETWORK_STATE: used to detect hotspot state to not disable wifi/data if hostpot is enabled
  • android.permission.READ_PHONE_STATE: to check if mobile data need to be disabled on Doze if configured
  • android.permission.ACCESS_WIFI_STATE: to check if WiFi needs to be disabled on Doze if configured
  • android.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: Übersetzungsstatus

Übersetzungsstatus

The Translations are hosted by Weblate.org.

Close

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, unforce and step commands through Shizuku.
  • Tune Doze timings: applies custom Doze timing values chosen in the tunables screen with settings put global device_idle_constants and device_config put device_idle commands through Shizuku.
  • Control motion sensors: disables motion sensing when Doze starts and re-enables it on exit with dumpsys sensorservice restrict and dumpsys sensorservice enable through 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 wifi and svc bluetooth commands through Shizuku.
  • Adjust power settings in Doze: toggles battery saver, airplane mode, biometrics and location mode during Doze with settings put commands 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 disable and pm enable through Shizuku.
  • Block app notifications: turns notifications off and on for user selected apps during Doze with a service call notification command through Shizuku.
  • Keep service in Doze whitelist: adds itself to the system Doze whitelist with dumpsys deviceidle whitelist through Shizuku for reliable operation.
  • Self grant permissions: grants itself DUMP, WRITE_SECURE_SETTINGS and READ_PHONE_STATE with pm grant through Shizuku so it can read idle state and apply settings.

Android APIs or commands used

  • pm grant
  • dumpsys deviceidle force-idle deep
  • dumpsys deviceidle force-idle
  • dumpsys deviceidle unforce
  • dumpsys deviceidle step
  • dumpsys deviceidle whitelist
  • dumpsys sensorservice restrict
  • dumpsys sensorservice enable
  • dumpsys activity activities
  • settings put global device_idle_constants
  • device_config put device_idle
  • device_config reset
  • settings put global low_power
  • settings put global airplane_mode_on
  • settings put secure biometric_keyguard_enabled
  • settings put secure location_mode
  • svc data enable
  • svc data disable
  • svc wifi enable
  • svc wifi disable
  • svc bluetooth enable
  • svc bluetooth disable
  • am broadcast -a android.intent.action.AIRPLANE_MODE
  • pm suspend
  • pm unsuspend
  • pm enable
  • pm disable
  • service 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.

Close

Changelog

What's new for version 1.10.2

Features

Bug fixes

Code refactoring

Close

Permissions

17 permissions requested

  • android.permission.ACCESS_NETWORK_STATE
  • android.permission.READ_PHONE_STATE
  • android.permission.WAKE_LOCK
  • android.permission.RECEIVE_BOOT_COMPLETED
  • android.permission.ACCESS_WIFI_STATE
  • android.permission.CHANGE_WIFI_STATE
  • android.permission.FOREGROUND_SERVICE
  • android.permission.POST_NOTIFICATIONS
  • android.permission.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS
  • android.permission.READ_LOGS
  • android.permission.WRITE_SETTINGS
  • android.permission.QUERY_ALL_PACKAGES
  • android.permission.DUMP
  • android.permission.WRITE_SECURE_SETTINGS
  • android.permission.FOREGROUND_SERVICE_SPECIAL_USE
  • moe.shizuku.manager.permission.API_V23
  • com.akylas.enforcedoze.DYNAMIC_RECEIVER_NOT_EXPORTED_PERMISSION
Close

Sources

2 sources

1.10.2 GitHub · com.akylas.enforcedoze
Selected Download
1.10.2 F-Droid · com.akylas.enforcedoze · com.akylas.enforcedoze
Download