yashsingh1/xdaforums huggingface dataset:
[Android Apps and Games] ssrij:
I don't think it's an issue or bug, but rather a side effect of turning off WiFi and mobile data. Perhaps the system decides not to leave Doze mode because the WiFi and mobile data is disabled, because there's no point to leave Doze to sync apps because there isn't any Internet available. I'll have to look into the OS code to see if this is device-specific or a general behavior, and adjust the setting's description accordingly.
[Android Apps and Games] David_D36:
Is there a way to make mobile data turn off during doze without root? Maybe through adb?
[Android Apps and Games] ssrij:
No, if there was, I would not be using root in the first place.
[Android Apps and Games] okij:
OK, thanks for explaining!

But IMHO the "Exited Doze mode" still should be catched somehow by ForceDoze (and then also be displayed in the Doze battery stats), since otherwise ForceDoze e.g. also wouldn't turn on disabled WiFi or mobile data again, which happened to me and other people in this thread.

I didn't disable WiFi with ForceDoze (now that there's a separate toggle for mobile data :)), because I only have a very little battery drain (just about 0,2-0,3% per hour) at night when WiFi is enabled.

Therefore your theory can't be true, as WiFi = Internet was available on my phone all night.

So I really hope that you find another culprit in the code. :fingers-crossed:
[Android Apps and Games] liver20:
I have fcs with forcedoze

https://db.tt/B0A3iUmb

Enviado desde mi Z1 mediante Tapatalk
[Android Apps and Games] ssrij:
java.lang.SecurityException: com.suyashsrijan.forcedoze was not granted this permission: android.permission.WRITE_SETTINGS

Can you verify ForceDoze has been granted the permission to modify system settings in System Settings -> Applications -> Settings button -> Modify System Settings?
[Android Apps and Games] ssrij:
I added a bit of logging code to the new version so it will now print to the logcat what the state is whenever the Idle state changes, this could help confirm if it's an issue with the app or something related to turning off mobile data/WiFi/both during Doze.
[Android Apps and Games] ssrij:
I have pushed a new update that fixes the issue where in some cases mobile data/WiFi doesn't turn on during screen on. Note: If you happen to turn on your screen during times when the phone's going from one state to another, then this issue would happen again, although you have to be really unlucky for the coincidence to occur.

I have also added a new (experimental) option to keep the device into Doze mode all the time, regardless of whether the motion sensors are enabled or not. This is more like a non-root workaround for keeping the device in Doze mode even when your device isn't stationary. It works by monitoring changes to the idle state, and when your device moves out of idle state during movement, it puts it back into Idle mode. It doesn't affect maintenance windows. Let me know how it works. To accurately test the effectiveness of this, please make sure:

Don't disable sensors on screen off under Main is turned on

Disable motion sensing for Doze under Xposed is turned off (reboot after changing this setting if it was previously on)

Disable motion sensing for Doze (non-root) under Doze enhancements is turned on

Toggle the ForceDoze switch off and on
[Android Apps and Games] noisyriver:
Generally: Do I have to reboot after changing this setting. I never did when I tried this...
[Android Apps and Games] ssrij:
Yes, because while the app will honor the setting's value immediately, the Xposed module will not, unless you reboot your phone, since the setting's value is loaded once on boot-up.
[Android Apps and Games] ianmacd:
For root users, is this option intended to allow other apps continued access to the motion sensors while not affecting dozing?

Or, put another way, is this option intended as an alternative to the Xposed-dependent Disable motion sensing for Doze option?

I'm just trying to make sure that I continue to understand all of ForceDoze's features and when I might want to use them.
[Android Apps and Games] ssrij:
Yes, it's essentially the non-root version of the Xposed workaround to prevent Doze from accessing motion sensors but not other apps. This setting is based on a theory, so there's no guarantees on how well it will work, but I recommend testing this feature for a whole day before coming to any conclusion and reporting me the result.

I know wording can be improved, and I'll also hide other related options depending on whether the Xposed or non-root option is enabled/disabled for less confusion
[Android Apps and Games] HowJesNo:
in the latest update there is option disable motion sensing for Doze (non-root). it should also say at Disable mobile data during Doze (root)

just a small notice. great app.
[Android Apps and Games] Ipse_Tase:
Logs

A minor suggestion: at some point would you consider adding an option to disable logging (assuming one is satisfied and convinced that FD works fine) and also look into log rollover after a certain time or even preserve only the last X hours (say 24 by default).

For some folks I guess the log clean up is not a routine.

Cheers.
[Android Apps and Games] okij:
IMHO you could simply switch mobile data and WiFi back to their previous states each time a Screen On is received, so they will be back to normal even if an "Exited Doze mode" event is not catched. Wouldn't this make sense and be possible?

I didn't know this too. :cyclops: I think it would be a good idea to add a hint in the settings or even a pop-up notification that reminds the user to reboot after toggling the Xposed settings.
[Android Apps and Games] ssrij:
I am actually going to hide it from non-root users in the next update
[Android Apps and Games] ssrij:
Will do in next update
[Android Apps and Games] ssrij:
Good idea, I'll make the change

Will do
[Android Apps and Games] colonel_lp:
yes, my lock screen timeout is 30s and doze delay 1min, so does 1.5hrs cpu wakelock seem high or normal for a 1m30s delay over 5hrs?
[Android Apps and Games] ssrij:
1.5 hours is calculated by the time spent by the wakelock * number of times the wake lock was created. In your case, that would be 60 times (1.5 hours / 1 min 30 secs). If you turn off/on your device a lot of times, then it will increase the total number of wake locks created, and thus the total time spent by the wakelock.
[Android Apps and Games] noisyriver:
Still not working, after enabling, rebooting: moving device - exit doze

restartet FD - still no success
[Android Apps and Games] ssrij:
How did you check it wasn't working?
[Android Apps and Games] turtle254:
Galaxy s6 (not rooted) ... Looks like it works, screen on/off triggers doze and movement does not take it out of doze.

One question, I needed to check both boxes under settings i.e. "Disable motion sensing for Doze (non-root)[/I] under Doze enhancements "

and "Don't disable sensors on screen off" . The reason I ask is that Don't disable sensors on screen off was checked in the box and Disable motion sensing for Doze (non-root)

was not, on the new update. Thanks for all your work..

One bug is clearing battery stats and then closing screen ... then turning back on all the stats are relisted again, tried it several times and no way to remove all the old stats.
[Android Apps and Games] ssrij:
Yes, you only needed to check Don't disable sensors on screen off if it was not already checked. This was to make sure the sensors keep enabled during Doze. In the next update, this will be handled automatically.

Can you try clearing it from Settings -> Clear Doze stats? Perhaps, try it after turning off ForceDoze.
[Android Apps and Games] turtle254:
Tried both ways. The only way is to clear stats is to turn off ForceDoze and back on. But this work around has to be done each time to clear stats.
[Android Apps and Games] ssrij:
I have pushed another update. I have added support for a new broadcast (com.suyashsrijan.forcedoze.CHANGE_SETTING), that will allow you to alter specific ForceDoze settings via Tasker. So perhaps, you can turn on Disable mobile data during Doze only at night using a special Tasker profile and turn it off in morning. I have also added a new activity that lists all supported Tasker broadcasts, it can be found in Settings > Tasker broadcasts. It will provide more details on the types of broadcasts supported by the app and the values that you need to pass to the broadcast (if applicable).

There are other small changes based on some of the feedback I've received today included in the update.
[Android Apps and Games] turtle254:
Galaxy s6(not rooted) ... Option to turn off mobile data during doze is still available for me as not rooted, but I don't get

the warning the that I need "SU permission denied " when check and uncheck the option.
[Android Apps and Games] ssrij:
That error is thrown because the app checks for SU permission and grants the READ_PHONE_STATE permission (which is required on top of root privileges to toggle mobile data). If your phone isn't rooted, the check will obviously fail, hence the error. In 1.3.4, the option to disable mobile data during Doze will be hidden if your phone isn't rooted, so you won't be able to toggle it.
[Android Apps and Games] ianmacd:
A minor request:

When you announce a new version on XDA, could you please mention the version and rev number?

You're so prolific at the moment that, even when a device is updating in front of our eyes, we can't be sure that the Play Store isn't already processing a new push from you. :D

A version number would be helpful here to know that we are running the latest code. It would also help prevent bugs fixed in version Y from being reported as still present by people who think they are running Y, but are actually still on X.

Thanks.
[Android Apps and Games] turtle254:
Galaxy s6 and I'm not rooted, but since ver. 1.3.4 rev 38, It did not remove that option. So I just checked/unchecked it several time and noticed the error about had gone away, as if I was rooted?

This is also what you had ask me to do early on "adb -d shell pm grant com.suyashsrijan.forcedoze android.permission.READ_PHONE_STATE.

It will give you the error regardless of whether the permission is granted or not because it checks for root and not the permission,

you just have to ignore it. " . I had done this and I'm on ver. 1.3.4 rev 38 not rooted, maybe that's the problem.
[Android Apps and Games] ssrij:
Will do. Whenever I push a new update, I update the APK link in post #1. You can always compare your version number to the version number in post #1
[Android Apps and Games] colonel_lp:
Thanks, that's what a thought. I probably only turned my screen on about 4 times, which is why I wondered why it was so high. Wakelock detector was showing 14 wakelocks.

xperia Z3 d6603 | RSXW mm
[Android Apps and Games] almoped:
Trouble turning mobile data back on.

Thanks for making this.

Sometimes /often the app does not seem to turn mobile data back on. This happens both when the app is displaying a permanent notification and when not. I'll try to attach logs.
[Android Apps and Games] liver20:
Was disable .

I enabled it . But when install apps, this option not enable by Default?

Enviado desde mi Z1 mediante Tapatalk
[Android Apps and Games] ssrij:
You should first update to 1.3.4 and then check whether this happens again or not
[Android Apps and Games] liver20:
I enabled it . But when install apps, this option not enable by Default?

Was disabled

Enviado desde mi Z1 mediante Tapatalk
[Android Apps and Games] ssrij:
This option has to be manually enabled by the user, it cannot be automatically enabled. When you click on Auto-rotate/brightness fix option, it will show you a dialog asking you to authorize the app to modify system settings, and when you click on Authorize button in the dialog that is shown to you, it will take you to this page to allow ForceDoze to modify system settings. Did you not do that, or see the dialog?
[Android Apps and Games] liver20:
Yes, but, i Know where is the issue, today, was restaured app with titanium backup, and Maybe this is the problem

Enviado desde mi Z1 mediante Tapatalk
[Android Apps and Games] noisyriver:
With GSAM, it shows exactly when the device is in doze. I did activate the setting as described, restarted FD and turned off the screen. Waiting some minutes, move the device, wait again some minutes and in GSAM I see exactly the time it left doze (when moving the device) and that it did not enter doze again.

Disabling the option, doing the same, GSAM shows nothing.
[Android Apps and Games] ssrij:
Did you reboot your device after turning off the Xposed setting?
[Android Apps and Games] Pupet_Master:
Yes, i disabled sensors and set it to doze on charge as well
[Android Apps and Games] ssrij:
Let me know if it still happens with you on 1.3.4
[Android Apps and Games] Pupet_Master:
Thanks, i'll test it up.

By the way, good job on the feedbacks, you are doing an amazing work
[Android Apps and Games] turtle254:
Donation sent
[Android Apps and Games] pinoholo:
I'm on CM13 root, on the latest update i don't see the option to turn on Disable Mobile Data even if I reset the app
[Android Apps and Games] ssrij:
Also you shouldn't have both the non-root and Xposed option for disabling motion sensing turned on. Don't forget to restart your device after either turning off or on the Xposed option.
[Android Apps and Games] pinoholo:
After reinstalling the app problem solved. Thanks
[Android Apps and Games] mrgigabyte2002:
Is it possible to get the apk before 134 app the newests 133 before 134 was working perfect for me putting the commands from computer with version 134 I can't disable data
[Android Apps and Games] ps89:
Hello [MENTION=5427507]ssrij[/MENTION], which 'Disable motion sensing for Doze' option is preferable actually? Root or non-root? Thanks. :)
[Android Apps and Games] noisyriver:
Yes, enable, restart FD, reboot, test.

Restart FD again and tested again.

No success.
[Android Apps and Games] Arstoien:
just a question: with Tasker I'm able to reliably put the device in doze with some delay after screen off – say 5 min. But, obviously, can't disable significant motion sensor. Wouldn't it be possible to allow Tasker to send a broadcast to ForceDoze to enter Doze? This would alow some users to set a delay for Doze without requiring a wakelock. Because imo "saving battery“ (by entering doze) in the expense of having a wakelock is a bit silly.

Sent from my Nexus 5
[Android Apps and Games] okij:
Thanks for your new update 1.3.4 rev 38!

It seems like the exiting of Doze mode now always works correctly. Yesterday evening I also tried "Disable motion sensing for Doze (non-root)" for a while and it seems to work. I let Greenify show the Doze times too and there were quite a lot of entering and exiting of Doze mode, which I suppose to be correct in this case, since Doze immediately kicks in again after being disabled by a motion sensor. Now I'm using "Disable motion sensing for Doze (root)" again, since my phone is rooted.

However, I still have some issues (some of them also reported by other users):

My phone didn't enter Doze maintenance mode last night, see attached full log. I used neither "Disable WiFi during Doze" nor "Disable mobile data During doze".

When using "Clear stats", the Doze battery stats don't always get cleared correctly. Sometimes the cleared entries appear again in the list.

The items in Doze battery stats are not in the correct order (see attached screenshot).

The timestamps in Doze battery stats use different time formats (e.g. "11:00:00 pm" instead of correct "23:00:00" - it's not on the screenshot, but happened yesterday evening with rev 38 too).

Thanks and keep up the good work! :)
[Android Apps and Games] noisyriver:
With Tasker you are already able to start FD service (see post 1). If you set the delay to zero this should be what you are looking for. Also you can now change settings of FD with Tasker.

But I don't understand your idea. Obviously something needs a wakelock, in this case it would be tasker. Even worse, as tasker doesn't work properly with time context and doze you need to enable the reliable clock option in Tasker. Which will completely disable any doze service.

Last thing: As long as you don't set the delay of locking the screen to some minutes I don't think that you will see any remarkable battery drain because of this one wakelock of FD...
[Android Apps and Games] Arstoien:
The Wait action I'm using in tasker doesn't use wakelock but alarm. And works well enough – hasn't been delayed ones for over a few days. And yeah, I haven't turned on the reliable alarms in the settings. I've been monitoring the activity with Greenify's Doze notification and it always enters doze 5 min after screen off.

The unreliability comes when the device is dozing, because even apps in the doze whitelist, are restricted to one alarm per 15 min.

What you're suggesting would probably work, haven't tested it, but I only fear that the service hasn't been made to be turned on and off so often, but instead – occasionally for specific purpose, like navigaition, etc.

Sent from my Nexus 5
[Android Apps and Games] noisyriver:
I'm pretty sure that if you use the reliable alarm option in Tasker you won't get doze. I suspect Greenify gives here a false notification, as FD does too. GSAM shows me that I don't have doze at all as soon as I enable this option in Tasker. Needed some time to find the responsible because I noticed this for a longer time even before using FD that my device did not doze when I used Tasker.

You will find some information of you Google for this. E.g.here: https://m.reddit.com/r/Android/comm...r_on_marshmallow_its_reliable/?ref=readnext_7
[Android Apps and Games] okij:
[MENTION=5427507]ssrij[/MENTION]:

I just did a comparison of "Disable motion sensing for Doze (root)" and "Disable motion sensing for Doze (non-root)" by recording a GPS track. For this I used Geo Tracker, which of course I whitelisted and which works well without ForceDoze. The results were:

- With "Disable motion sensing for Doze (root)" enabled, there was a whole part of the track missing, so GPS sensor seems to be off or non-accessible while Doze is active.

- With "Disable motion sensing for Doze (non-root)" enabled, the track was continuous, but missed details (i.e. a number of waypoints that normally would have been recorded, so Geo Tracker showed just a straight line while Doze was active.) So it seems that Geo Tracker was hindered to run in the background (although it was whitelisted) while Doze was active.

Can anybody else please test and confirm this behaviour?

I really hope that it can be fixed, at least for "Disable motion sensing for Doze (root)", which I prefer.
[Android Apps and Games] darkwolf_99:
The date isn't in order in the log. Not a big deal, just feedback;)
[Android Apps and Games] Arstoien:
As I said, I'm not using reliable alarms. No wakelocks, and adb shows Dozing too.

Sent from my Nexus 5
[Android Apps and Games] ssrij:
Guess for some reason your GPS app uses motion detection for no reason. Can you use Runkeeper or Google Maps?

Also, whenever you update the app, you also need to restart your phone, so the Xposed module can be reloaded correctly. This also applies when you toggle the Xposed workaround setting in the app.
[Android Apps and Games] ssrij:
Let me take a look into why it isn't showing up for rooted users, I'll push a fix soon
[Android Apps and Games] kryshnakishore:
Yes for me too... Latest app is funky...
[Android Apps and Games] mrgigabyte2002:
thanks for the reply

just want to make sure you understand that i am using the root workaround adb command because i am not rooted this is the adb command i used

adb -d shell pm grant com.suyashsrijan.forcedoze android.permission.DUMP
[Android Apps and Games] ssrij:
Okay, then it isn't a bug. The option isn't showing for you because you're not rooted, and it requires root to work. Previously the option was accessible to everyone, but it wouldn't work if your device wasn't rooted (even if you turned it on, it won't have any effect), so I decided to hide it.
[Android Apps and Games] mrgigabyte2002:
are you saying this option does not work for your new version ? because the version im on now the option seems to work fine i dont get no emails or anything until i unlock my phone again

using the command

im on 1.3.3 ver37
[Android Apps and Games] okij:
I now did the same test with MyTracks (which has been suspended by Google in May, but still works; also whitelisted). With both "Disable motion sensing for Doze" methods the track is interrupted for the time the device is in Doze mode.

AFAIK the GPS sensor belongs to the other sensors, thus normally turned off by the standard Doze mode. That's why I would need a working option in ForceDoze.

Of course I did so for all my tests today.
[Android Apps and Games] ssrij:
It works, but it's hidden (on v1.3.4) if you're not rooted, because it needs root to work. That would probably be an effect of Doze, which is short term and not because of turning off mobile data, whose effect is long term.
[Android Apps and Games] darkwolf_99:
If possible, it'll make FD better to turn on wifi/data by timing, like 10 seconds in every half of hour/one hour, etc., to let email app and IM app to get new messages. Thanks.
[Android Apps and Games] ssrij:
So your GPS is being suspended by Doze it seems, which is the default behavior of Doze anyway. I don't think there's a workaround for it though unfortunately. I might be able to stop it via Xposed but cannot guarantee. I'll be looking into it soon
[Android Apps and Games] ssrij:
For that, I would need to use a wakelock, or run a AlarmManager service, both of which would negate the positive effects on battery life caused by turning off WiFi/mobile data. You should rather not turn off WiFi/mobile data if its too important for you. Also, in the last update I added a new broadcast for changing settings, so perhaps you can use Tasker to toggle that setting off during the day and on during the night.
[Android Apps and Games] darkwolf_99:
Understood, battery life is No. 1 for FD, I can't agree with you more.
[Android Apps and Games] ssrij:
Does it enter maintenance normally? Or does it not only at night?

Seems like a conflict with the ForceDoze service. Try turning off ForceDoze before trying to clear the stats.

It uses your system time format (12h/24h) to format the time, it doesn't do on its own. If it changes format, it could be either because you toggled the time format in Date & Time settings, or something else did. I'll look into why this happens, perhaps I need to implement formatting on the app level, rather than relying on the system. This might also explain why the logs aren't in order
[Android Apps and Games] liver20:
What is the time for doze delay recommend [MENTION=635976]ssr[/MENTION]j, well all users?

Enviado desde mi Z1 mediante Tapatalk
[Android Apps and Games] ssrij:
I don't think you should delay it by more than 1-2 minutes
[Android Apps and Games] ianmacd:
I still see the switching time format bug, too. Installing a new version of ForceDoze always resets it to what it should be, but sooner or later it switches to the wrong format again.

In my case, this phenomenon is the reason that the battery stat logs aren't in the correct order. Having a mixture of 12 and 24 hour notation breaks sorting.