[App] ForceDoze - Force Doze mode after screen off, disable motion sensors, etc

Search This thread

ssrij

Senior Member
Sep 7, 2013
1,842
1,867
London
Hi all,

ForceDoze 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 fully 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.

Features:

  • Force enable Doze right after screen off
  • Disable motion sensors so Doze doesn't periodically poll the sensors to check if the device is stationary or not. This provides an additional boost to battery life
  • Whitelist apps so they don't get suspended or disabled when Doze mode is active
  • Doze battery stats: Shows you all the times your device has entered/exited Doze mode, and how much battery was available during those times. It will only work when ForceDoze service is turned on
  • Tasker support so you can now send com.suyashsrijan.forcedoze.DISABLE_FORCEDOZE broadcast intent to disable the ForceDoze service, or com.suyashsrijan.forcedoze.ENABLE_FORCEDOZE to enable the ForceDoze service
  • Tasker support for adding/removing apps from the Doze whitelist, so you can send com.suyashsrijan.forcedoze.ADD_WHITELIST broadcast intent along with packageName as the key and the package name you want to add as the value, in Extras. To remove the app from the whitelist, send the com.suyashsrijan.forcedoze.REMOVE_WHITELIST broadcast intent along with packageName as the key and the package name you want to remove as the value, in Extras. So for example, in Tasker, you can set Action as one of the intents above, and in Extras, add packageName:com.your.packagename and then save the task
  • Enable Doze mode on your device if your device OEM has disabled it (experimental)
  • No-root mode so you can use this app without root privileges (Requires you to execute an ADB command from your PC to grant it the android.permission.DUMP permission, instructions inside app and app description on Play Store)

Force Doze is a free & open-source app, so you can grab the app and the source code from:

Play Store: https://play.google.com/store/apps/details?id=com.suyashsrijan.forcedoze
Play Store Beta testing: https://play.google.com/apps/testing/com.suyashsrijan.forcedoze
Latest APK (v1.4.0 rev68): https://www.androidfilehost.com/?fid=457095661767144607
Latest Beta APK: Not available right now #
Github: https://github.com/theblixguy/ForceDoze

Frequently asked questions:

Auto-rotate/brightness doesn't work after turning on the device
Please turn on Auto-rotate/brightness fix in settings and restart the ForceDoze service. If that doesn't work, turn on "Don't disable sensors on screen off" in app Settings instead

I have trouble getting push notifications from apps (ex: GMail)
Only high-priority push notifications are delivered to the app while the device is in Doze mode, normal-priority notifications (ex: from Gmail) are delivered during the Doze maintenance window or when you wake up the device. This is an OS restriction and there's nothing that can be done about it

My device doesn't turn on and I have to restart my device to fix
This is most probably being caused by disabling motion sensors, pretty common on LG devices. To fix, turn on "Don't disable sensors on screen off" in app Settings and restart the ForceDoze service

The app doesn't work properly for some reason
If you're rooted, then make sure SU requests made by the app aren't getting denied by the SU app on your phone. Your SU app will occasionally prompt you to grant or deny SU access to ForceDoze and if you deny or ignore the dialog, then the app will not work properly and will fail to do certain things, like re-enabling sensors after exiting Doze or turning off Doze properly after screen on

Please let me know if you spot any bugs or unwanted behavior, or would like me to add more features to the app!
 
Last edited:

ajeesh vijayan

Senior Member
Sep 10, 2012
879
185
kerala
sensor re enabling

I have posted this on Reddit page..(if you didn't see the issues posted there)
app doesn't ask for su
works even without su or adb(greenify notifies me)
even after sometime screen turned on rotation and auto brightness don't work
enabling sensor service option in app , disables doze on motion

thank you
sorry for my English
 

Donnie Sins

Senior Member
Mar 30, 2012
1,271
645
Is this the same like Greenify Aggressive Doze?
If I'm correctly interpreting the OP, it isn't. Greenify does use the sensors, while this app isn't.

Installed it 5 minutes ago, will report back after a while of testing.


Edit: I have problems too with brightness not responding anymore, until I uncheck and turn autobrightness back on...

Sent from the Matrix
 
Last edited:

optimummind

Senior Member
Jun 17, 2012
2,185
892
Orange, CA
@ssrij I'm on 1.0.7 and I cant access the Google app store. I keep getting the "check your connection" error. What do I need to whitelist? Something is not waking back up properly. Don't have this issue with Greenify aggressive Doze.

Sent from my SM-G935P using Tapatalk
 

YYvo

Senior Member
Nov 25, 2010
74
24
If I'm correctly interpreting the OP, it isn't. Greenify does use the sensors, while this app isn't.

Installed it 5 minutes ago, will report back after a while of testing.


Edit: I have problems too with brightness not responding anymore, until I uncheck and turn autobrightness back on...

Sent from the Matrix
First, kudos for a great app. Was looking for alternative to greenify since i consider it too aggressive for me. Just wanted to inform i have the same adaptive brightness bug. Must be ticked off and on for it to work.

Sent from my D6603 using XDA-Developers mobile app
 

ssrij

Senior Member
Sep 7, 2013
1,842
1,867
London
I experience rotation issues after installing your app on nexus 7v2. Excited to test this :)

Sent from my Nexus 7 using Tapatalk

Please download the latest APK from the main post, reset ForceDoze from app settings, go to app settings again, turn on Enable Auto-rotate/brightness fix, turn on ForceDoze service and see if it fixes the issue

I have posted this on Reddit page..(if you didn't see the issues posted there)
app doesn't ask for su
works even without su or adb(greenify notifies me)
even after sometime screen turned on rotation and auto brightness don't work
enabling sensor service option in app , disables doze on motion

thank you
sorry for my English

Please download the latest APK from the main post, reset ForceDoze from app settings, go to app settings again, turn on Enable Auto-rotate/brightness fix, turn on ForceDoze service and see if it fixes the issue

Is this the same like Greenify Aggressive Doze?

If I'm correctly interpreting the OP, it isn't. Greenify does use the sensors, while this app isn't.

Installed it 5 minutes ago, will report back after a while of testing.

Edit: I have problems too with brightness not responding anymore, until I uncheck and turn autobrightness back on...

Sent from the Matrix

Please download the latest APK from the main post, reset ForceDoze from app settings, go to app settings again, turn on Enable Auto-rotate/brightness fix, turn on ForceDoze service and see if it fixes the issue

Can we please have a whitelist option. Would love to use this , but still get notifications from Twitter and Snapchat. Thanks!

It's there, go to Menu > Settings > Whitelist apps
 
  • Like
Reactions: Donnie Sins

ssrij

Senior Member
Sep 7, 2013
1,842
1,867
London
First, kudos for a great app. Was looking for alternative to greenify since i consider it too aggressive for me. Just wanted to inform i have the same adaptive brightness bug. Must be ticked off and on for it to work.

Sent from my D6603 using XDA-Developers mobile app

Please download the latest APK from the main post, reset ForceDoze from app settings, go to app settings again, turn on Enable Auto-rotate/brightness fix, turn on ForceDoze service and see if it fixes the issue
 

ssrij

Senior Member
Sep 7, 2013
1,842
1,867
London
@ssrij I'm on 1.0.7 and I cant access the Google app store. I keep getting the "check your connection" error. What do I need to whitelist? Something is not waking back up properly. Don't have this issue with Greenify aggressive Doze.

Sent from my SM-G935P using Tapatalk

I don't think whitelisting Play Store will work, but you can try adding com.android.vending to the app whitelist. I don't know why that happens, try clearing Play Store cache or force stopping it, and make sure your internet connection is active and working, that could also be a reason why
 

ajeesh vijayan

Senior Member
Sep 10, 2012
879
185
kerala
everything fine now .. but

latest build works great..
but still I don't understand.. app didn't request su (fresh installed latest build), I didn't grant dump
but still everything works...

:)
 

Top Liked Posts

  • There are no posts matching your filters.
  • 155
    Hi all,

    ForceDoze 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 fully 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.

    Features:

    • Force enable Doze right after screen off
    • Disable motion sensors so Doze doesn't periodically poll the sensors to check if the device is stationary or not. This provides an additional boost to battery life
    • Whitelist apps so they don't get suspended or disabled when Doze mode is active
    • Doze battery stats: Shows you all the times your device has entered/exited Doze mode, and how much battery was available during those times. It will only work when ForceDoze service is turned on
    • Tasker support so you can now send com.suyashsrijan.forcedoze.DISABLE_FORCEDOZE broadcast intent to disable the ForceDoze service, or com.suyashsrijan.forcedoze.ENABLE_FORCEDOZE to enable the ForceDoze service
    • Tasker support for adding/removing apps from the Doze whitelist, so you can send com.suyashsrijan.forcedoze.ADD_WHITELIST broadcast intent along with packageName as the key and the package name you want to add as the value, in Extras. To remove the app from the whitelist, send the com.suyashsrijan.forcedoze.REMOVE_WHITELIST broadcast intent along with packageName as the key and the package name you want to remove as the value, in Extras. So for example, in Tasker, you can set Action as one of the intents above, and in Extras, add packageName:com.your.packagename and then save the task
    • Enable Doze mode on your device if your device OEM has disabled it (experimental)
    • No-root mode so you can use this app without root privileges (Requires you to execute an ADB command from your PC to grant it the android.permission.DUMP permission, instructions inside app and app description on Play Store)

    Force Doze is a free & open-source app, so you can grab the app and the source code from:

    Play Store: https://play.google.com/store/apps/details?id=com.suyashsrijan.forcedoze
    Play Store Beta testing: https://play.google.com/apps/testing/com.suyashsrijan.forcedoze
    Latest APK (v1.4.0 rev68): https://www.androidfilehost.com/?fid=457095661767144607
    Latest Beta APK: Not available right now #
    Github: https://github.com/theblixguy/ForceDoze

    Frequently asked questions:

    Auto-rotate/brightness doesn't work after turning on the device
    Please turn on Auto-rotate/brightness fix in settings and restart the ForceDoze service. If that doesn't work, turn on "Don't disable sensors on screen off" in app Settings instead

    I have trouble getting push notifications from apps (ex: GMail)
    Only high-priority push notifications are delivered to the app while the device is in Doze mode, normal-priority notifications (ex: from Gmail) are delivered during the Doze maintenance window or when you wake up the device. This is an OS restriction and there's nothing that can be done about it

    My device doesn't turn on and I have to restart my device to fix
    This is most probably being caused by disabling motion sensors, pretty common on LG devices. To fix, turn on "Don't disable sensors on screen off" in app Settings and restart the ForceDoze service

    The app doesn't work properly for some reason
    If you're rooted, then make sure SU requests made by the app aren't getting denied by the SU app on your phone. Your SU app will occasionally prompt you to grant or deny SU access to ForceDoze and if you deny or ignore the dialog, then the app will not work properly and will fail to do certain things, like re-enabling sensors after exiting Doze or turning off Doze properly after screen on

    Please let me know if you spot any bugs or unwanted behavior, or would like me to add more features to the app!
    14
    How does this compare to naptime/doze settings editor? :)

    It's much better than both, and doesn't confuse you with too many settings or anything like Doze Settings Editor/Naptime does. Just flip the switch and enjoy more battery life. On top of that, it allows you to customize some parts of your Doze experience, again, without modifying any Doze values or anything. For example, you can add a delay before ForceDoze kicks in, turn off WiFi/mobile data during Doze to save even more battery, etc. It also logs useful stats for you, so you can see how many times your device entered/exited Doze, how much battery was used and how much time was spent in Doze. It also offers Tasker support, so you can turn on/off ForceDoze, add/remove apps from Doze whitelist and modify ForceDoze's settings directly from Tasker. There are lots of things that you wouldn't find in other apps.

    I have noticed that Naptime has added a few features from ForceDoze (like disabling motion sensors, the same auto-rotate/brightness fix, doze off on charging, etc), before that the developer didn't even bother updating the app since January 2016! If you're coming from Naptime, I would like to tell you that ForceDoze has had these features pretty much from the start.
    12
    I have updated the APK link for latest beta (sorry for delays, was out so didn't get time to do so). It's mostly updates to translations.

    • I have decided against including incomplete stats in the new UI so as to not clutter it, they will be available in the old UI, and you will automatically be switched to it if there's incomplete stats saved on your device
    • Xposed permission issue will be fixed when I hear back from the developer about a possible fix, I don't experience this issue so it's very difficult to fix it for others
    • There are quite a lot of issues reported related to whitelist and not getting notifications and as I have said so many times, whitelisting does not guarantee that your app will be able to access the network and/or provide notifications. Only GCM High Priority notifications are delivered during Doze.
    • Noticed there was someone who had trouble streaming Spotify on WiFi even after whitelisting it. By default, WiFI is put to sleep on screen off, you can make it stay on during screen off in WiFi settings, that should hopefully fix the issues.

    I have an exam on the 7th July and won't be providing any more updates until then. After that, I'll look into existing issues and fix some of the remaining fixable issues. Rest of them are highly device specific and difficult to reproduce, so I will look into them later.
    10
    Could you tell me how it saves more battery – by entering Doze quicker? Realistically that's not very much different battery-life-wise, however the wakelock that comes with the service now, does make a difference. I just can't make sense of why would I use an app to save battery life that holds a wakelock every time I turn off the screen. Or forces me to change my lockscreen settings.

    Really, I don't mean to bring a negative tone, I'm just trying to understand your decision on the wakelock and why you say it saves more battery than greenify, which does essentially the same but without the wakelock.

    What made you use a wakelock compared to the previous method you used? If it's reliability for some devices, isn't it possible to make it optional?

    Sent from my Nexus 5

    How does it save more battery?
    By putting your device into Doze faster, and by disabling motion sensors, so it stays in Doze, even if your device isn't stationary.

    How is it better than Greenify AD?
    It's free, it's open source and it has no ads, and nothing is going to change about those three things, ever. It offers a bunch of customization features and other features that you won't find in Greenify AD, but not too much as to confuse the users (like Naptime perhaps). On top of that, it allows users to enable Doze on any unsupported device (running M obviously), which no other app does.

    Why does it use wake lock?
    First of all, in the latest version, it no longer uses wake locks if your lockscreen timeout value is set to Immediately. Now, if you use Doze Delay, then it will use wake locks, because there's no other way, but again, a warning is given to the user. The wake lock is present to prevent ForceDoze from putting the device into Doze until the lockscreen timeout and/or the Doze Delay (set by user) passes. I had received quite a few complaints regarding that. Previously, the app used Handlers and then switched to Timers, but both of them were very unreliable and they used to get suspended by the OS sometime after the screen off, and that prevented ForceDoze from putting the device into Doze. There's no other way in Android to schedule tasks like that, so the only choice left was to use a partial wake-lock that kept the CPU running to make sure the Timers fire correctly. It won't have any impact on battery life even if you had a lockscreen timeout of 1 min, but if the timeout is a lot longer, then yes it could have a bad effect. The app gives you a warning if your lockscreen timeout is high, and also gives you an option to make the device enter Doze regardless of the timeout. I rolled that out a few versions ago as an experimental feature, once I receive confirmation from some of the users that it doesn't have any effect whatsoever on the functioning of Doze and doesn't cause any unwanted behavior, I will change ForceDoze so it always ignores the lockscreen timeout. Just because Greenify ignores the lockscreen timeout does not necessarily mean it's the best thing to do. Even Doze itself activates after 30 mins by default on all devices, because the max lockscreen timeout value is 30 mins, I believe there is a reason why it does so and honors the lockscreen timeout.
    10
    Actually, I thought @okij's posting was very respectful. He knows the developer doesn't owe him a thing, but at the same time, he recognises that the project has stagnated somewhat in spite of numerous outstanding bugs. At the same time, Greenify has come back to life in the last few weeks and seen a flurry of development. Its aggressive doze implementation is now the most reliable for the greatest number of users.

    I, too, have switched back to Greenify from ForceDoze for this reason. There's no harm in letting the developer know this, and doing so does not imply an inflated sense of entitlement on the part of the informant. It's just good user feedback.

    FYI: Today I decided to uninstall ForceDoze.

    The reason is that it doesn't work reliably on my Z3 compact, as I've reported here a couple of times, and that there isn't any development anymore (the latest commit on the GitHub repository was on June 23th!) Therefore I don't think that the issues that I and several other users reported will be fixed.

    Instead I'm using Greenify's Aggressive Doze with it's Xposed Doze on the Go feature for a couple of weeks now, which is working rock solid and reliably here.

    Nevertheless I kept ForceDoze installed for the past weeks (without actually using it) to be informed about updates or new beta versions via Play Store. Well, there haven't been any updates for more than six weeks now, so it's time to say goodbye.

    @ssrij: This also means that I won't update my German translation for ForceDoze if you might decide to update it or to add features. Of course everybody is welcome to further work on the translation on your GitHub repository.

    It's just that I don't have a lot of time (full-time student, work, etc). The app works well enough for most users, it's just a few issues affecting certain devices/users. I'll look into the app again once I have free time to dive deep into the code, might just do a full rewrite or look into how Greenify is implementing AD.

    Anyhow, since the project is open source, others are welcome to submit fixes and improve the project in their own free time and continue the development of the app while I am not actively doing so.
Our Apps
Get our official app!
The best way to access XDA on your phone
Nav Gestures
Add swipe gestures to any Android
One Handed Mode
Eases uses one hand with your phone