yashsingh1/xdaforums huggingface dataset:
[Android Apps and Games] ssrij:
Use Google Clock app.
[Android Apps and Games] Aksell:
Try this settings-battery-battery optimization-select all apps-find force doze and select don't optimize because stock doze kills task while phone is turned off and maybe samsung's stock rom is killing backgroung acrivity while screen is off.And do you have any task killer apps or do you have greenify? If you have greenify don't hibernate Force Doze app.
[Android Apps and Games] skalogre:
You aren't the only one... Moto Play Z here, US model.

Both stock Google Clock and a few others I tried, whitelisted or not, screen won't come on for the alarm, or countdown timer.

I have disabled Forcedoze for the time being.
[Android Apps and Games] kk-ftp:
Doesn't make sense for it to work and then suddenly stop working until i open my phone. Hoping developer sorts this out. I can't be bothered using another clock app
[Android Apps and Games] DB126:
Obvious answer is to disable/uninstall ForceDoze. There are other well regarded apps (eg: Greenify) that can perform similar tasks. Whether those apps have a similar impact on your clock apps will need to be tested. FWIW I do not have this issue on several devices using only Greenify but none are Samsung gizmos.
[Android Apps and Games] mrgigabyte2002:
I have samsung and use greenify I use I can't wake up pro alarm and no problems here
[Android Apps and Games] anarchist18:
I have checked the battery optimization setting and it is already disabled for ForceDoze

I did not have greenify and other task killers, I did install greenify yesterday for testing and disabled ForceDoze since it was not behaving as expected, but it turns out Greenify works even less than ForceDoze so I unistalled it and activated ForceDoze again.

Does anyone know a solution for non rooted device to keep doze mode on as much as possible when the screen is off?

Thanks
[Android Apps and Games] DB126:
Without root you have little control over the stock doze mechanisms regardless of app.
[Android Apps and Games] ssrij:
The stock Clock app on my old Galaxy S7 edge also didn't work but switching to the Google Clock app fixed the issue, and it was the same for some other devices as well.

Google has specified on their page that a developer needs to use newer APIs so their alarms fire even when Doze is active:

There's not much I can do here unfortunately if the OEM decides to make their own changes to how Doze works or if the Alarm/Clock app has a bug affecting certain devices.
[Android Apps and Games] mrSpider:
"""" Android 6.0 (API level 23) introduces two new AlarmManager methods:""" -- what about android 5 ? android 5 has another methods?
[Android Apps and Games] Licaon_Kter:
What does it matter what 5 has or not? It does not have Doze so don't ask here.
[Android Apps and Games] Gold_Diesel:
I'm trying to enable and disable the option to "Disable Wifi during Doze" using an intent sent from Tasker but it doesn't seem to work. I can enable and disable Force Doze but changing settings doesn't work. Anyone else experience something like this and found a fix?

Or am I just being dense and missed something?
[Android Apps and Games] Ubimo:
I'm on Samsung Stock Nougat.

Is the "energy monitoring app" working during ForceDoze?

This app is responsible to suspend apps during doze. It's not in the whitelist and I don't know the exact name of this app.

Edit: [MENTION=5427507]ssrij[/MENTION]

Is this Samsung Stock Nougat compatible?

Is ForceDoze going do be further developed or is this end of life?
[Android Apps and Games] kicksilver:
Hey [MENTION=5427507]ssrij[/MENTION]

I'm currently on a stock Nexus 5. If I do those adb commands, it won't alter anything in the system, will it? Or are those app-specific?

Also, what about the maintenance windows? If I don't whitelist WhatsApp, for example, I'll never receive messages, as long as the display is off?

Thanks
[Android Apps and Games] milojoseph:
I think development has stopped until his device updates to nougat
[Android Apps and Games] Licaon_Kter:
No. Yes.

It should get some eventually, but mostly not.

not until but since ?!

Anyway, the app still works. ;)
[Android Apps and Games] ssrij:
I have begun working on the next version which adds support for N. I still do not have an N device with me (if someone has a spare one please consider donating it to me!), but hopefully I'll find a way out to add N support properly. I have pushed a new beta out (and updated the link to the new beta on page 1).

Anyone who's on N, please try using this new beta and report back your results. Logcat would be helpful as it will contain useful data that I can use to figure out if it's working fine or not.

Note: You will have to manually grant android.permission.WRITE_SECURE_SETTINGS via ADB if you are not rooted.
[Android Apps and Games] ssrij:
Whoops, forgot to update beta link properly on page 1. Now fixed!
[Android Apps and Games] milojoseph:
I assumed you have a Samsung device.
[Android Apps and Games] ssrij:
I sold it last year to get an iPhone 7, as I am learning how to make iOS apps. I no longer have any Android device nor the money to buy one.
[Android Apps and Games] milojoseph:
Oh man don't go to the dark side . haha but i know ios apps is easier to maintain
[Android Apps and Games] ssrij:
Haha, I just want to be good with both platforms. You are more valuable to an employer if you're good at making apps for both platforms!
[Android Apps and Games] milojoseph:
Do have to grant your app secure settings? By using the same command to enable it to use the dump?
[Android Apps and Games] ssrij:
Yes, if you're not rooted.
[Android Apps and Games] Richy19:
Seems good on CM14.1

In the settings, the doze delay amount, is that seconds or minutes?
[Android Apps and Games] ssrij:
Minutes.
[Android Apps and Games] ssrij:
I have pushed another update to the beta channel. You can grab the APK from page 1 (as always).

* QuickTile support: You can now add a ForceDoze quick tile to your Quick Settings to quickly and easily toggle ForceDoze on or off. You can also long press the tile to quickly open ForceDoze

* Some fixes so ForceDozeService works more reliably on Nougat

Once again, if you're on Nougat, please try using the beta and let me know if everything works fine. A logcat would be helpful to really see if ForceDoze is working properly on Nougat or not.
[Android Apps and Games] zera89:
Can I provide logcat even without root?
[Android Apps and Games] ssrij:
Yes, you can grab it using ADB:

adb logcat > logcat.txt

This will save the logcat data into a file called logcat.txt in the folder which contains the ADB tool. You can change the path of the file by adding it after the >, so adb logcat > C:/Users/username/Desktop/logcat.txt
[Android Apps and Games] darkwolf_99:
Awesome! Support N! I'll let you know whether new beta works well in my Emui5 (N7.0).
[Android Apps and Games] shuini:
Thanks for app。:)

Log
[Android Apps and Games] ssrij:
Seems to be working fine for the most part, although the service is crashing while exiting Doze due to a bug somewhere else in the code. I'll fix that now.
[Android Apps and Games] ssrij:
Submitted a new update to the beta channel. Only bug fixes and as always, you can grab the latest APK from page 1:

* Fixed: Crash when clicking on Donate option.

* Fixed: Crash when ForceDozeService exits Doze

* Fixed: ForceDoze not adding itself to Doze whitelist on Nougat. Now, it will show you a notification that will take you to the battery optimisation settings to manually add ForceDoze, as it's not possible to add it automatically by ForceDoze on Nougat.

* Fixed: ForceDoze calling deviceidle to add itself to whitelist, causing an exception (and potentially a crash) because DEVICE_POWER permission wasn't granted. The permission cannot be granted to apps like ForceDoze, hence a workaround has been implemented as described above.

Nougat users, please let me know if the app is working fine on your device. A logcat would be helpful in case you're having issues.
[Android Apps and Games] milojoseph:
It's working tomorrow I'll send a log cat. I'm not having that much issue. Only question is, is the experimental working for nougat, the disabling sensors. Cause i Remember it was in marshmallow.
[Android Apps and Games] ssrij:
Not yet working, but I'll be fixing that next once I can confirm ForceDoze itself is working as expected on Nougat. I dont think the experimental option is needed as the device will still enter Doze even if there's motion, but again, I don't have an N device so I can't confirm.
[Android Apps and Games] milojoseph:
http://pastebin.com/3Sr0RyzM

here is mine but i'll take one again during the night

i'm using the latest apk
[Android Apps and Games] ssrij:
Well it doesn't contain any entry regarding ForceDoze. It would be better to upload the full logcat file on Dropbox or Google Drive and share the link, as Pastebin has some limits on how much text you can paste.
[Android Apps and Games] milojoseph:
https://www.dropbox.com/s/qdc6y7kfc4r9gls/logcat.txt?dl=0

I noticed a lot of errors. Do you know where there are coming from so i can contact the devs
[Android Apps and Games] ssrij:
Still doesn't contain any ForceDoze entries. Are you rooted? If you are then you can get the logcat from within the app, from Settings -> Debug logs.

Also, those errors have nothing to do with ForceDoze. They're caused by Android itself. Nothing to worry as they happen all the time on all devices due to various reasons.
[Android Apps and Games] milojoseph:
Im not rooted. 2mm hopefully when i leave my phone to sleep during the night i can pick up something.
[Android Apps and Games] darkwolf_99:
Thank you for new beta. I wonder if I have to uninstall previous version first.
[Android Apps and Games] ssrij:
No need as ForceDoze will restart the service once you install an update, so new changes take effect immediately. If you're on beta and switching to stable then it's considered a fresh install and you'll have to run ADB command again if you're not rooted.
[Android Apps and Games] darkwolf_99:
Noted well, thanks a lot. V50 works better than v49 in my emui5, N 7.0. And it seems doze isn't broken when phone is moving. The experimental option hasn't been checked. It's so great!
[Android Apps and Games] ssrij:
That's good to hear! I need some more positive reports from my beta testers before I make the new version available to everyone.
[Android Apps and Games] darkwolf_99:
I'll keep you reported:laugh:
[Android Apps and Games] jlb1959.01:
beta works great on vs985 running xdabbeb 3.1.....
[Android Apps and Games] darkwolf_99:
It works well to keep doze when the device is moving. But sometimes v50 can not make the device enter doze again after the screen is off. It past more than one hour after the screen turned off.

Emui5, N 7.0
[Android Apps and Games] ssrij:
In the log, I see: Cancelling enterDoze() because user turned on screen and 0ms has not passed OR disableWhenCharging=true

Have you turned on Turn off while charging option in Settings? If that's true then the device won't go into Doze mode if your phone is connected to charger.
[Android Apps and Games] milojoseph:
I agree with above users v50 doesn't put my device in doze mode. I disabled the turn off while charging. Checking my logs, it looks like my s7e is not picking up your app at all, but your app says it's going in doze mode
[Android Apps and Games] milojoseph:
I'll rest my phone for 9 minutes and around 3:05 I'll provide one
[Android Apps and Games] milojoseph:
herer you go
[Android Apps and Games] David_D36:
Thank you for the app, it has been working perfectly. However, I still think I should be getting better idle battery life. Is it possible to optimize the things that are greyed out?
[Android Apps and Games] optimummind:
If you wanna shut off the greyed out apps, you can use Greenify to hibernate them. By using Greenify hibernate & ForceDoze together, I reduced my standby drain from 4 to 5% per hr to slightly less than 2%/hr.
[Android Apps and Games] ssrij:
That's beyond the scope of the application. ForceDoze is only intended for all things related to Doze, and not optimizing apps. You can add apps to the whitelist to be exempt from some of Doze's restrictions, but you cannot "optimize" an app or add/remove apps from the App Standby list via ForceDoze.
[Android Apps and Games] David_D36:
Thanks for the input. My main goal is trying to reduce my battery usage due to radios when I'm out of the house. On 4G LTE and even on my school's wifi, it drains over 4% per hour idle.
[Android Apps and Games] mpaopao:
Have to restart my phone every a few hour to get auto-brightness and rotate works. Already check and allow permission the fix option.

Oneplus one sultan cm13 rom.
[Android Apps and Games] gsw5700:
Auto brightness not working on htc10 after last update. Tried fix in settings was OK on previous version
[Android Apps and Games] ckhnet:
Great app... i just update to 1.2.3 version .

some query below ...

what 's i can have while enable tasker support ?

what is adb cmd to enable this on non-root phone ?

and i have some issue with LG H860 (g5) always-on display, it not "always-on" anymore while enter doze mode sometime ( and i cannot add "Alwasy-on diplay" app in whilelist ; system apps!? )

and fingerprint sensor unlock not work in doze mode, i need press the bottom to weakup the phone ( originally i hold my finger on fingerprint sensor can unlock)

thanks all in advance .
[Android Apps and Games] zonazolazia:
So, will I be getting notifications (whatsapp,bbm), text messages, and call when the phone is locked? Or do I have to put all those in the whitelist?
[Android Apps and Games] mata77:
It happened that during a call the screen remains on (I answered the lockscreen), the sensor is then activated as if I receive a call? i have s7 edge
[Android Apps and Games] ssrij:
Have you tried toggling the quick settings for each? That would be much better than rebooting, but toggling is what the Auto-rotate/brightness fix does.

Have you tried giving the phone some time to readjust after turning on the screen?

I didn't touch anything related to auto-rotate/brightness in last update. Do you give auto-brightness some time to adjust after turning the screen on?

Yes, normal priority notifications will be delivered during a Doze maintenance window, high priority notifications will be delivered even when the phone is Dozing.

What do you mean?
[Android Apps and Games] ssrij:
There's nothing you need to do to enable Tasker support. It's already present. You just have to create a new Tasker task and use the Intents feature.

The command is adb -d shell pm grant com.suyashsrijan.forcedoze android.permission.DUMP

If you aren't rooted and you haven't granted the permission via ADB, then how are you experiencing issues with the app? The app will obviously not work without the permission
[Android Apps and Games] Arstoien:
Generally all developers of chat apps make the chat notifications high priority, so they don't get delayed from Doze. However, Whatsapp dev team is stubborn and haven't done that, so your Whatsapp notifications will indeed get delivered only in maintenance windows.

So if you use Whatsapp a lot, I'd recommend whitelisting it.

Sent from my Nexus 5
[Android Apps and Games] momomok:
what is the difference between the whitelist in app and the Ignore battery optimizations options in system settings??
[Android Apps and Games] ssrij:
None, the app just makes it easier to add/remove apps from the Doze whitelist so you don't have to go deep into Settings to enable/disable optimization
[Android Apps and Games] kojak1989:
better then Naptime app ?
[Android Apps and Games] bgx:
Great app but when I use it on my huawei mate s double tap 2 wake isn't work anymore. Anyway to fix this? I also tried with sensors on but also double tap 2 wake doesn't work.

Gesendet von meinem CRR-L09 mit Tapatalk
[Android Apps and Games] ssrij:
Does it used to work before using ForceDoze? When the device was in Doze mode?
[Android Apps and Games] ssrij:
This has more features than Naptime. If you want to tweak all the Doze related settings, then you can use Naptime. If you want a simple app with no need to mess around settings and everything, use this.
[Android Apps and Games] mpaopao:
Tried toggling quick setting but not working. Have to reboot to get it works.
[Android Apps and Games] ssrij:
Well I guess the only way to fix it on your device is to turn on "Enable motion sensor access for all apps" in the app's Settings.
[Android Apps and Games] ssrij:
Well the logcat doesn't contain any entries by ForceDoze or ForceDozeService
[Android Apps and Games] milojoseph:
I don't know what to do, I'm on T-Mobile s7e nougat non rooted... It appears on my notification. I capture logs the moment i unlock my phone.
[Android Apps and Games] ssrij:
Try running this command: adb logcat -d -s "ForceDozeService","ForceDoze" > logcat.txt and upload the file
[Android Apps and Games] milojoseph:
here you go
[Android Apps and Games] ssrij:
It seems to be working fine. There aren't any errors or warnings. Can you tell me the output of this command: adb shell settings get global device_idle_constants
[Android Apps and Games] milojoseph:
it says null when i type it in
[Android Apps and Games] ssrij:
Okay, now run these commands for me after connecting your device to your PC, turning off the screen and waiting 1 minute without any interruptions:

adb shell settings get global device_idle_constants

adb shell dumpsys deviceidle

Let me know the output.
[Android Apps and Games] milojoseph:
Im using this app to get the values. As it states in the op that it can get the default value without root

https://xdaforums.com/android/apps-games/root-doze-settings-editor-android-t3235130/page137
[Android Apps and Games] ssrij:
Have you granted the app WRITE_SECURE_SETTINGS permission?
[Android Apps and Games] milojoseph:
adb -d shell pm grant com.suyashsrijan.forcedoze WRITE_SECURE_SETTINGS

that's the command right? Maybe add another slider to check if app was granted write secure settings.... like how you did if the app is active or not
[Android Apps and Games] ssrij:
adb -d shell pm grant com.suyashsrijan.forcedoze android.permission.WRITE_SECURE_SETTINGS

The check will be added in the next beta.
[Android Apps and Games] milojoseph:
Yup i did. No confirmation on and. But no error.

I googled the global device and found an app that manually changes those settings

2Nd image is stock
[Android Apps and Games] darkwolf_99:
Yeah, I've turned on the option when I got the log, but I've not charged my phone before I turned on the screen and found my phone hasn't entered doze.

It happened several times yesterday. So last night I uninstalled forcedoze and installed v50 again to make a clear installation and turned off the option.

I always charge my phone every day using a plugin with a timer when I go to bed at night. The timer is set to 4 hours. After 4 hours, the plugin cuts off the electricity automatically.

From the snapshot, you can see there is no Exit record from 2:58 to 7:08. At 2:58, the plugin cut off the electricity and forcedoze made the device enter doze again, but there's no exit record when I got up and turned on the screen at 7:08. So I wonder if forcedoze made the device enter doze unsuccessfully or there is only a record issue after the screen is turned off for a long time.

I always charge my phone using a plugin with a timer when I go to bed and the timer is set to 4 hours. After 4 hours the plugin cuts off electricity.
[Android Apps and Games] ssrij:
If there is no EXIT record then it probably means the maintenance period is causing some sort of conflict here. I'll have to investigate further. I think removing support for turning on/off WiFi and mobile data and other things during maintenance periods should fix it. It could also be because you turned on the screen right when the maintenance period started. It's not a big deal though, as long as ENTER record is present.

I would suggest you monitor the timings in the Doze battery stats and GSAM to see if the timings match (or are nearly the same), that would suggest the device is entering Doze properly. Once that's confirmed, check the amount of time spent in Deep Doze and add up the time spent in Doze as mentioned in the Doze battery stats and see if they match (or are nearly the same). I would advise you reset GSAM first (so time spent before does not show up in our calculations), before going to sleep would be fine Then in morning, do these calculations.
[Android Apps and Games] darkwolf_99:
I got it. Maybe it is the same reason when the issue happens by day after the screen turns off for several hours. I've installed gsam and used its adb command line.
[Android Apps and Games] darkwolf_99:
Maybe forcedoze cannot give my phone more additional doze time because I monitored the doze time records from forcedoze, gsam and greenify (only turned on the Notification).

From the three screen shots, you can see there's 16 minutes of doze time in gsam and greenify, but 25 minutes in forcedoze. I think it's big difference.

My OS is emui5, I think maybe it changes android N too much to let forcedoze work well.
[Android Apps and Games] darkwolf_99:
I spent more time to get more records.

The screen turned of at 14:58.

The dozing time is

51m in GSAM

59m in greenify, 12+4+2+10+15+10+6

71m in forcedoze, 23+23+25

The dozing time record in forcedoze is nearly 40% more than in GSAM.

And in emui4, android M, from the record of greenify, I can see forcedoze make the device into doze immediately when the screen turned off.

The format of greenify's record is aa|bb - cc =dd.

aa is the time when screen turns off

bb is the time when device goes into doze

cc is the time when screen turns on

dd is the dozing time

When forcedoze works good, as in Android M, in greenify's record, there isn't bb. I've monitored it before. So I think forcedoze doesn't really work in my emui5, Android N.
[Android Apps and Games] ssrij:
I have pushed a new beta out. I changed a few values in device_idle_constants, let me know if that makes any difference!
[Android Apps and Games] darkwolf_99:
Thanks a lot.

But I think v51 still cannot make my device into doze as soon as the screen turns off. Here are my three tests. Before the last, I've restart my phone. Sorry to let you know that.

V51 is a clean installation.

Maybe you'd better need more feedback from other users.
[Android Apps and Games] milojoseph:
Mine doesn't even last long
[Android Apps and Games] ssrij:
Ok what I would suggest doing is, play with the values of Doze Settings Editor and let me know which combination of values make your device go into Doze faster
[Android Apps and Games] darkwolf_99:
My device hasn't rooted. What kind of adb command lines can make it into doze immediately when the screen is off?
[Android Apps and Games] milojoseph:
It doesn't work for nougat user

Did he open source the app maybe you can fork it.
[Android Apps and Games] ssrij:
What about Naptime?

If not, then you can use ADB:

adb shell settings put global device_idle_constants <key>=<value>, <key>=<value>, ...

There's plenty of information available on Google on the tunables that you can modify to change Doze behaviour.
[Android Apps and Games] milojoseph:
Nap time is also for rooted users. I'm downloading doze editor. Also Im going to grant it write storage
[Android Apps and Games] ssrij:
I don't think it will work as it doesn't support the new tunables added in Doze. You will have to use the adb method I mentioned earlier
[Android Apps and Games] milojoseph:
I chose one of the preset, freebee
[Android Apps and Games] ssrij:
Well as I said, it doesn't support the new Doze light tunables, but never mind, go ahead and try the command and let me know if it makes your device go into Doze faster (and stay there)!
[Android Apps and Games] milojoseph:
So I enter the commands and google what to insert in the key and value like the doze editor
[Android Apps and Games] milojoseph:
I get 4hrs of doze from gsam but only 2mkns from your app