yashsingh1/xdaforums huggingface dataset:
[Android Apps and Games] ssrij:
What the app does is set a custom value for many of the tunables (in device_idle_constants) on screen off in order to make the device enter Deep Doze quicker. The app sets device_idle_constants to null on screen on because it doesn't make any difference what values it contains because your device (obviously) won't doze when the screen is on. So when you query device_idle_constants on screen on, getting a null value is expected. Getting a null value on screen off isn't.

Those values you specify above is for Deep Doze, which your device only enters after Light Doze. So those values won't take effect until your device transitions from Light to Deep Doze state. As I said before, in Nougat, there are new tunables, specifically for Light Doze state:

light_after_inactive_to

light_pre_idle_to

light_idle_to

light_idle_factor

light_max_idle_to

light_idle_maintenance_min_budget

light_idle_maintenance_max_budget

min_light_maintenance_time

min_deep_maintenance_time

I would say the important ones are light_after_inactive_to and light_idle_to, setting them to 10000 should make the device enter deep Doze quicker. You can also set light_max_idle_to and light_pre_idle_to to 10000 as well.
[Android Apps and Games] milojoseph:
Can there be an update to have this in the beta your suggestions.
[Android Apps and Games] ssrij:
Have what?
[Android Apps and Games] milojoseph:
Recommended setting for light doze. But I'll put them in adb and test it out
[Android Apps and Games] Ubimo:
[MENTION=5427507]ssrij[/MENTION]

I'm on SuperMan Rom 2.3 (Samsung TW Nougat, S7 edge) and enabled "deactivate WLAN during doze". When waking up my phone WLAN stays disabled sometimes. Why?

This also happens with mobile data connection. I have latest beta installed.
[Android Apps and Games] ssrij:
A logcat would be helpful. You can grab once after using the app so the necessary log entries are there.
[Android Apps and Games] ssrij:
I have added support for Doze Tunables in ForceDoze. You can use this feature to modify doze parameters directly (requires root at the moment, but you can copy the ADB command to manually update the tunables). Using this feature

will disable ForceDoze

, because ForceDoze will always override those tunables in order to put the device into Doze immediately, so it doesn't make sense to modify such tunables when ForceDoze is active.

[IMG="Doze Tunables"]http://i.imgur.com/jxjrtc0l.png[/IMG] [IMG="Doze Tunables #2"]http://i.imgur.com/2WZLp9Ul.png[/IMG]

Nougat users, you can use this feature to experiment with different combinations of tunable values and let me know which combination puts the device into Doze the fastest, because I cannot test this feature as I don't have an Android device (and it won't work in emulator).

You can grab the latest beta APK to try it out (or wait for Play Store to push the update to your device)
[Android Apps and Games] story:
My phone has been on for 30 mins after boot @ 100% battery.

It also has a 30 mins wake lock and CPU usage by ForceDoze.

Is this normal?
[Android Apps and Games] Ubimo:
Here is the logcat.txt: https://mega.nz/#!G9gXWbyR!Z91jfSnCBawrXvLKMjOKaw39Oen8NN7WBb1ElM9JBJE
[Android Apps and Games] shuini:
Add screen on to force Doze option？Thank you！
[Android Apps and Games] ssrij:
Have you turned on Doze Delay? Or do you have a higher lock screen timeout value in Lockscreen and Security settings? Those things can cause ForceDoze to use a wake lock to keep the device awake until the delay/timeout passes.
[Android Apps and Games] shuini:
Oh，google translate :o

Force Doze mode after screen on
[Android Apps and Games] ssrij:
Force dozing on screen on will break app functionality. Play store won't download updates, time won't update, etc.
[Android Apps and Games] shuini:
time show hours,minutes,and seconds.

Time will be updated.
[Android Apps and Games] story:
Those settings are fine. I don't even have a password/pattern.

Persistent Notification was on and I've turned that off now. It was good for a while until it drained another 5 percent in 2 hours. Something is definitely causing wake lock.

I just turned off "Ok Google" and freeze another app that's using location service. I will update when I find the culprit.
[Android Apps and Games] Bewildered Wolf:
No the thing is , Dozing simply means sleeping. How can the phone sleep while the screen is on ? And even if he is able to do so, no app will work, no push notifications, no updates, no download and also no time update no battery counter moving. So if you want that ?

You can use BBS to find which app this not letting your phone sleep. :)
[Android Apps and Games] jlb1959.01:
fantastic app,I will send my stats tomorrow morning,however I just wanted to say no flaws at all,I'm on xdabbeb 3.1, vs985.. my over note drain is zero,I'm getting a complete day with a charge..again thank you to the developer....
[Android Apps and Games] ssrij:
The wake lock created by ForceDoze is called ForceDozeTempWakelock. If you don't see it listed in a 3rd party wake lock/battery stats app then it means the wake lock isn't (directly) caused by ForceDoze, although it's possible the app is indirectly making another app/service hold a wake lock. This will require more investigation to figure out what exactly is going on.
[Android Apps and Games] story:
No, I don't see that wakelock.

Looking at everything from BBS, it's the Google Service that's cause the CPU usage.

Doze Stats didn't show it went into Doze even once.

I have this alarm - android.server.device_idle.STEP_IDLE_STATE

After 70 mins CPU reading:

24 mins deep sleep

40 mins 384mhz (2nd lowest)

6 mins highest

I will try this https://xdaforums.com/android/general/guide-to-fix-data-battery-drain-t3298080 and report back.
[Android Apps and Games] Bewildered Wolf:
Looking forward to your report back :)
[Android Apps and Games] milojoseph:
adb shell settings put global device_idle_constants light_max_idle_to=10000, light_pre_idle_to=10000

is being tested giving you updates soon
[Android Apps and Games] ssrij:
You will also have to modify inactive_to, locating_to, sensing_to, etc.

Use the app's in-built Doze Tunables feature which I released yesterday to change these, it will be easier.
[Android Apps and Games] story:
It works fine until I start using it for a bit and all the wake lock comes back.

It's the Google stuff.

Maybe I need Greenify.
[Android Apps and Games] Bewildered Wolf:
Greenifing google stuff won't work bro. And the opposite can happen. It can start eating your battery beacuse google has a wakelock named gms.persistent something which is the reason GPS is running persistently. But if you will greenifing GPS or any google stuff, greenify will try to close it while persistent wakelock will open it again. Resultinh in more battery drain.

//Press thanks If i helped you :)
[Android Apps and Games] story:
I will try this next.

https://xdaforums.com/android/general/guide-0-0-hour-idle-battery-drain-stock-t2973588
[Android Apps and Games] sohailss111:
On Android 7.0, when Doze starts after screen off, is it supposed to show under Light Doze or Deep Doze? In GSAM, it doesn't show under either of them.
[Android Apps and Games] Bewildered Wolf:
Yes that's a great thread. I have tried that :)
[Android Apps and Games] ssrij:
Both, as your device spends time in both states, although less in Light and more in Deep (in ideal conditions).
[Android Apps and Games] ssrij:
Some good news: I bought an used Nexus 5X, which should arrive by Tuesday or Wednesday. Now I can work on the app properly!
[Android Apps and Games] darkwolf_99:
Definitely good news!

Today I tried to use greenify with only aggressive doze by ADB command lines in my unrooted emui5, Android 7.0. It seems greenify can skip light doze and make device into deep doze directly. I monitored it for several times now.

Hope forcedoze can skip the light doze and make OS into deep doze immediately when the screen turns off. With greenify, it takes about ten minutes to doze after the screen is off.
[Android Apps and Games] darkwolf_99:
Greenify's record.
[Android Apps and Games] ssrij:
I am using the same approach as Greenify to put the device into Deep Doze state, but I'm not sure why it doesn't work. I'll look into it and hopefully have a fix by next weekend.
[Android Apps and Games] milojoseph:
Letting you know it's working
[Android Apps and Games] ssrij:
That's great!
[Android Apps and Games] story:
I still have 20% of the time waking up, which is better.

However using Force Doze or stock ROM, the WIFI cannot keep on.

It seems there's no fix for this, except using an iPhone.
[Android Apps and Games] Bewildered Wolf:
I don't have any problems with wifi.
[Android Apps and Games] ssrij:
I'll look into it when I get my Nexus 5X tomorrow. I didn't change anything related to WiFi, if it works in Marshmallow then it should work in Nougat as well.
[Android Apps and Games] Norbzzz:
That app make no sense on my smartphone the way I use it, but it really saved my Shield tablet : I have absolutely no social app or any notification on it, I just want it to have battery when I need to browse for half an hour, read emails, or watch a video. As I carry it alot in vacations, the standard doze mode isn't really usefull. it's been 2 weeks now, but I definitively donate something in the next month.

Cheers !
[Android Apps and Games] Ubimo:
[MENTION=5427507]ssrij[/MENTION]

Could you find anything that's causing the problem?

WLAN and mobile data does not enable after waking up my phone sometimes.
[Android Apps and Games] ssrij:
I will.

I got my Nexus 5X today, and I got to know it only comes with a USB C cable so I cannot plug it to my Mac, so I had to order a USB C to USB A cable, which should arrive tomorrow. After that, I can start testing the app and fix the issues.
[Android Apps and Games] Ubimo:
I'm on a Samsung Galaxy S7 edge stock Nougat
[Android Apps and Games] ssrij:
Good news

Well, I managed to find a spare USB-A male to USB-A male cable lying in my room and my roommate had a USB-A female to USB-C male cable so I managed to do some debugging today.

But that's not really the good news. The real good news is: if you're rooted, ForceDoze will work just like it did on Marshmallow, so it will put your device into Deep doze immediately (or after a custom delay if you've set it). I can confirm it works just as expected. Here's a screenshot: http://imgur.com/a/pGt16

(PS: Ignore the battery usage as I'm working on a dev device with beta software and other modifications)

If you're not rooted, ForceDoze will use a workaround which involves changing certain tunable values to make the device enter Deep doze faster. It needs more testing as on some devices it doesn't work as expected (like Galaxy S7 edge). It worked once on my Nexus 5X, but stopped working after that, so I need to do some more debugging. I highly suggest you use the in-built Doze tuneable feature to tune certain values and see if it makes your device enter Doze quicker. You don't need to do this if you're rooted, only if you aren't. There's a copy button that you can use to copy the ADB command and share/paste it to your computer to execute. This will make my job easier because then I won't have to spend so much time experimenting with values.

I have also fixed the following bugs:

* Whitelist activity sometimes not refreshing or not loading packages (Thanks to Almoped on GitHub)

* Doze stats scrolling down automatically when you open it (Thanks to Almoped on GitHub)

* Crash on certain devices if they turn on Auto-rotate/brightness fix

I have also added support for App Shortcuts for Nougat 7.1 (or above) users, so you have easy access to Settings and Doze Battery Stats.

I have pushed a new beta to the beta channel, you can also grab the latest APK from page 1. There are a few small issues that needs fixing, I will hopefully fix them by the end of this week. If all goes well, I'll make it final and publish it to stable channel next week.
[Android Apps and Games] dieccast39:
Just installed force doze and I am getting notifications from apps that I don't have in whitelist why is that??
[Android Apps and Games] ssrij:
Because high priority GCM notifications can bypass Doze, without affecting battery life. Normal priority GCM notifications are queued for delivery when the device exits Doze. That's how Doze is designed to work.
[Android Apps and Games] dieccast39:
Great thanks for the explanation but Tapatalk considered high priority?? ?
[Android Apps and Games] ssrij:
It depends on the developer. If the developer of the app uses high priority GCM notifications, then it will be delivered even in Doze mode. If not, then it will be delivered when the device exits Doze.
[Android Apps and Games] Bewildered Wolf:
I guess tapatalk changed this gcm priority thing int the last few updates beacuse earlier after greenify tapatalk and not whitelisting it in force doze, the notifications were stopped. They were only seen when the device is unlocked or sometimes while opening the app. But from a last few days, tapatalk notifications are coming even when the phone is in deep sleep mode.

Do you thing that's good ? Beacuse every tapatalk notifications is disturbing the phones deep sleep ?
[Android Apps and Games] ssrij:
It's definitely not good for battery. What you can do is, turn on the option "Turn off WiFi during Doze" / "Turn off mobile data during Doze" in ForceDoze, this will prevent apps from accessing the Internet during Doze. This way, the app won't be able to receive battery draining notifications. You will get those notifications when you turn on your device and your device reconnects to the Internet.
[Android Apps and Games] Bewildered Wolf:
But you know brother', sometimes we need whatsapp, hike , telegram and we need instant notifications. So for my case this will not be a Good idea. Is there any other method just to stop notifications from tapatalk ?
[Android Apps and Games] ssrij:
You can ask the developer to fix it or use Greenify the app so you don't get notifications during Doze. I'll see if there's a way to do it from ForceDoze.
[Android Apps and Games] Bewildered Wolf:
Asking the developer will be difficult. And i have greenified it bro. Still notifications.

But we can stop push notifications from tapatalk settings. That will be okay i guess.

Btw OT: Are you indian bro ?
[Android Apps and Games] ssrij:
I have found a way to block notifications on a per-app basis (it will require root). This can help save even more battery as high priority GCM notifications will be blocked from being delivered to the device, which is helpful if there's an app that pushes a lot of notifications and you don't want it to.

I will push a new beta out tonight which will include this feature.
[Android Apps and Games] ssrij:
I've also figured out another way to save battery: which is to disable packages during Doze. This way, selected apps will be completely disabled during Doze mode, so no background services, notifications or anything. This is a bit too extreme, but useful for some users who don't care about notifications or other functionality being lost due to the selected app(s) being disabled and want maximum battery life.

I'll be adding this feature as well in today's beta.
[Android Apps and Games] Bewildered Wolf:
Waiting for the beta testing :laugh:

Good work bruh :)
[Android Apps and Games] inspron:
For those of us on Nougat 7.0

without

root (S7 Edge 7.0 T-Mobile), is there any benefit in using this app at this point in time? I've just signed up for the beta but after reading the last few pages of comments I am still confused on which feature is currently working for non-root Nougat users.

Should we avoid using "Modifying Doze Tunables" per the app warning message and just rely on ForceDoze service instead?

There are two settings menu items that are mutually exclusive but I am curious why have two separate options?

- Don't disable sensors on screen off

- Disable motion sensing on Doze
[Android Apps and Games] ssrij:
Yes, the app offers the same benefit to non-root users as it did on Marshmallow. There's nothing new for non-root users unfortunately as many of the features require root privileges.

Currently, force-dozing on Nougat (without root) is being beta tested, as it's no longer possible to force-doze by using calling deviceidle on Nougat which is what the app used to do on Marshmallow, so now the app has to resort to changing some in-built Doze values to make the device enter Doze quicker (or immediately).

If you're rooted, then ForceDoze works exactly like it did on Marshmallow.
[Android Apps and Games] ssrij:
I suggest you use it to figure out the right combination of values that make your device enter Doze quicker. Use this feature if the app isn't working as intended on your device. (Hint: If its not working as intended, then make sure WRITE_SECURE_SETTINGS permission is granted via ADB, just like you granted the DUMP permission)

Using this feature disables ForceDoze (obviously) because it overrides those values with its own.
[Android Apps and Games] ssrij:
1) Because they work differently (Don't disable sensors on screen off works by disabling sensors system-wide, which can sometimes have side-effects on some devices where things like ambient display or fingerprint sensor stop working when the screen is off. Disable motion sensing on Doze works by making the device re-enter Doze every 15 minutes because moving the device makes the device exit deep Doze. It does not disable sensors system-wide, but tries to stop motion sensing from putting the device out of deep Doze, by putting it back into Deep doze)

2) Because one of them works all the time while the other sometimes doesn't (and hence marked as experimental in the app)
[Android Apps and Games] inspron:
I learned a lot from your replies. Thank you!!!
[Android Apps and Games] milojoseph:
Can't wait for the good you and option to come out the experimental feature
[Android Apps and Games] ssrij:
I have pushed out a new beta to the Play Store beta channel. You can also grab the APK from page 1.

Changes:

* New Doze Notification blacklist feature: You can temporarily block certain apps from sending notifications to the device during Doze, which can be helpful if the app sends a lot of (high priority FCM) notifications and there's no option to turn it off from within the app's settings. This can help save some battery.

REQUIRES ROOT

* New Doze App blacklist feature: You can block certain apps (and its background services) from running during Doze mode. A lot of apps continue to run in the background and eat your battery even during Doze. Using this feature, you can temporarily disable such apps while your device is in Doze mode. This can help save more battery.

REQUIRES ROOT

* Privacy policy (you can find it in Settings -> About ForceDoze)

* You can now access Debug logs (Settings -> Debug logs) if you're unrooted (you will have to manually grant READ_LOGS permission via ADB)

* Usual bug fixes and small improvements so ForceDoze works more reliably
[Android Apps and Games] milojoseph:
Can your app detect those app that are being aggressive. Sometimes we can't tell and maybe an app can scan those apps
[Android Apps and Games] ssrij:
You can rely on third party battery monitoring apps like GSAM to detect such apps.
[Android Apps and Games] Bewildered Wolf:
Can't acess the new options even after having root and xposed.
[Android Apps and Games] ssrij:
Try reinstalling. It's a bug somewhere in SU where it doesn't show the SU dialog when the app requests it.
[Android Apps and Games] Bewildered Wolf:
I uninstalled the previous version. Again installed the previous beta.

SU didn't ask for root access. So, I click on one of the xposed features that requires root. SU asked for root access. Gave it. Still the other root features were not unblocked.
[Android Apps and Games] ssrij:
That's a little strange. Do this: Uninstall whichever version you have. Then grab the APK from page 1 and install it.

Let me know if you still have the issue. Idk why it happens, sometimes SU just works in weird ways.
[Android Apps and Games] jlb1959.01:
works great for me...
[Android Apps and Games] darkwolf_99:
V54 and v57 can make my device into deep doze directly, but as greenify, it takes about ten minutes after the screen is off, not immediately.

And I found something interesting that as long as there isn't "exit" records, it means forcedoze has made my phone into doze. If there are such records, my device hasn't been in doze after the screen turns off.

Is it possible to change the time in records to when the device goes into doze, not when the screen is off?

My os is emui5, Android 7.0
[Android Apps and Games] ssrij:
That's great to hear.

I'll look into this. Even on my Nexus 5X, the exit record doesn't show up. I've noticed it only happens when I move the device right before turning it on. If I don't, then there's an exit record. This is unfortunately a side effect of the app monitoring for changes to the maintenance mode state. When the app exits Doze, it checks if the last known Doze state was IDLE, and only logs the EXIT record if it was. I'll see what I can do, I can't just make it ignore the last know state as then the app will be logging EXIT record multiple times (when device goes out of Doze into maintenance mode), so will have to make some adjustments.
[Android Apps and Games] ssrij:
I can confirm ForceDoze is working fine on non-rooted Nougat devices. Here's a screenshot: http://i.imgur.com/i2jLk6h.png

PS: I disabled SU and then installed ForceDoze to simulate an unrooted phone.

I'll do some more experimenting today to see if it's possible to make the device go into deep Doze even faster (right now it spends at least 5 mins in Light state). If not, then this is probably the best that's possible.
[Android Apps and Games] darkwolf_99:
I'm going to do a clean installation for v57 to look if there's difference.
[Android Apps and Games] bigmike35:
anyways to get a update list of adb commands to type in for non-rooted phones? Also maybe something on tuneables (what values to edit) but seems like you have it kinda working pretty good from your last few statements on non-rooted phones.
[Android Apps and Games] ssrij:
On an unrooted Marshmallow device, you need to grant DUMP permission. On an unrooted Nougat device, you need to grant WRITE_SECURE_SETTINGS permission, in addition to the DUMP permission.

The command would be: "adb shell pm grant com.suyashsrijan.forcedoze android.permission.DUMP" (one line, without quotes). Same for WRITE_SECURE_SETTINGS, just replace the last part.

The description of each tunable is pretty self explanatory. You can easily figure out what each tunable is responsible for.
[Android Apps and Games] bigmike35:
So pretty much:

adb -d shell pm grant com.suyashsrijan.forcedoze android.permission.WRITE_SECURE_SETTINGS

Only thing we need to grant?

It must have updated as i grab this reply LOL. Thanks, I appreciate the feedback and work! I haven't gone into the tuneables because it ask to take over doze and I didn't want to mess with anything before I knew what I was doing.
[Android Apps and Games] Bewildered Wolf:
Still not working bro :(
[Android Apps and Games] ssrij:
Which device are you using, what version of Android is it running and which superuser app have you installed?
[Android Apps and Games] Bewildered Wolf:
Xperia Z2.

MM.

Custom Rom, Custom kernel.

Super SU 2.79. i guess that's the latest one.

Bro when i install the apk, it doesn't asks for root access.

So, i enable one of the xposed based feature which requires root. After that it asks for root access. But the other root features stay the same even after giving root permission.
[Android Apps and Games] ssrij:
It should ask for root permission when you run the app for the first time. Have you tried restarting your device?
[Android Apps and Games] Bewildered Wolf:
Yes, done that but it doesn't asks for root permissions unless i press that xposed based root feature.
[Android Apps and Games] ssrij:
A logcat would be helpful. Do this:

1) Uninstall app

2) Install app

3) Open app

4) Now grab a logcat

5) Send it to me
[Android Apps and Games] Bewildered Wolf:
Tell me if it's correct or not. Ll do it again.