yashsingh1/xdaforums huggingface dataset:
[Android Apps and Games] almoped:
Try WiFi-feature

This does seem to have fixed it. Thanks, I sent you some money.

Here's a small feature request. Could just be an option like "Try wifi"

If the user has wifi enabled upon screen-off forcedoze will turn it off while dozing and on again at screen-on, just like it is now.

But if no wifi is connected within, say 10 seconds, forcedoze will turnoff wifi and any subsequent screen-on's in the next, say 20 minutes, forcedoze will not reenable wifi. At a screen-on after 20 min has passed FD will give wifi another try.

Forcedoze will only try to enable wifi at screen-on (and maybe maintanence window, not sure how those work). So if wifi is searched for and not connected in 10 secs, wifi is disabled and if the screen remains on for more than 20 min FD will not turn wifi back on. FD would only try wifi again at the next screen-on.

If the user enables wifi within a 20min cooldown window FD will register the wifi-enabled at screen-off and remove the 20min cooldown.

This resembles location based wifi a bit, but I am hoping the timeout based approach would be better. And that what I've just written makes sence.

Edit:

This might seem to make it difficult for users to turn off wifi without FD trying to turn it on again at some time later. This could be solved by the user turning off wifi within the first 10 secs after a screen-on. FD would register this as wifi disabled and not turn it back on untill the screen has been turned off with wifi enabled.
[Android Apps and Games] ssrij:
That's beyond the scope of ForceDoze. You can use automation apps like Tasker to achieve that
[Android Apps and Games] ankushkushal:
Can you make xposed mod to enable doze on unsupported devices only... Your app made my doze available but only on enabling xposed module..
[Android Apps and Games] proag:
Hey, how can I add ForceDoze to tasker in order to disable Wi-Fi and mobile data only at the certain time I choose?

I saw the broadcast names in ForceDoze app but I don't really understand what I have to do.
[Android Apps and Games] ssrij:
Don't spam please. I will look into that later
[Android Apps and Games] ianmacd:
Unlike the OS's Doze whitelister, the ForceDoze whitelister doesn't return system apps.

Is that a bug or by design? It seems to me that they should match.
[Android Apps and Games] HowJesNo:
well, yesterday i flashed my S6 to stock operator firmware (TWO, Croatia.), installed and updated apps (boy did it got hot). charged it to 100%, battery manager said 20h left (on French XEF/or XEU it said 50) and left it overnight ForceDoze turned off, result in screenshot. no new apps since yesterday and now will try with ForceDoze enabled (ignore lock screen timeout: OFF, persistent notif: ON, disable wifi: ON, disable motion for doze: ON, lock screen settings set to immediately), no extra witelist apps in ForceDoze besides default ones. also quick charge is OFF.

Is it possible to add option to turn ON power saving mode when entering doze and turning off when screen on.

my next step will be to attemp rooting S6 with CF auto root.
[Android Apps and Games] ssrij:
Create your profile in Tasker (depending on time)

Add a Task

Add an Action to the Task

Set the Action to Send Intent (System -> Send Intent)

In the Action Edit screen, do the following

Set the Action to: com.suyashsrijan.forcedoze.CHANGE_SETTING

Set the first Extra field to: settingName:turnOffWiFiInDoze

Set the second Extra field to: settingValue:true

DO NOT TOUCH OR MODIFY ANY OTHER FIELDS

Save

That's it. You can add another Action (just like the one above) for settingName:turnOffDataInDoze for mobile data. settingValue can either be false (settingValue:false) or true (settingValue:true)

Note:

If your device has already entered Doze then changing settings will not have any effect until the device exits Doze (on screen on) and then enters Doze again (on screen off)
[Android Apps and Games] ssrij:
Strange, I do see apps exempt by OEM/system. I made the change a while back to read directly from Doze whitelist rather than internal whitelist, so whitelist can be more transparent about the packages that are whitelisted.

[IMG="Whitelist"]http://i.imgur.com/u3OZPUgl.png[/IMG]
[Android Apps and Games] ssrij:
I guess enforcing time format inside the app should fix this issue, rather than reading the format from the system. No idea why this happens
[Android Apps and Games] ianmacd:
Sorry. I wasn't clear enough.

Your whitelist does show already whitelisted system apps, but the app selector doesn't allow new system apps to be added to the whitelist.
[Android Apps and Games] ssrij:
That's by design. It only shows launchable packages, rather than all installed packages. It didn't make sense to spam the list with useless packages. Previously, apps were added/removed from the whitelist via package name, which I removed after adding a package chooser activity. I will be bringing back the option soon, so people can add/remove specific packages.
[Android Apps and Games] proag:
It worked! Thank you very much :)
[Android Apps and Games] okij:
I'm not sure about daytime since usually I turn on my phone about 1-2 times per hour, so Doze maintenance window isn't triggered by the system anyway. But I think it would be the same at daytime if I wouldn't touch my phone, i.e. the Doze maintenance window wouldn't work currently.

It used to work with an older revision of ForceDoze. I don't know which revision it was, but it must have been after you turned on the Doze maintenance window logging (which showed maintenance events then) and the current rev 38. You changed something in the code which improves the capturing of Doze mode events, I think it must have been after this change that the Doze maintenance window doesn't work anymore. Is that possible?

I'm quite sure that I already tried this, as this possibility was already discussed in the thread, neverthelessl the old events appeared again.

I definitely didn't change the format in settings, there's simply no reason for it. And no other apps (clocks, widgets, whatsoever) seem to have a problem with it, so it must be something about ForceDoze. If everything else fails, you could implement a toggle in settings for changing between 12h and 24h format, setting it first to the format that you fetch from the system.
[Android Apps and Games] noisyriver:
Obviously if you record a track (or navigate, or use you GPS for any other reason) you don't need FD to be running. Because your device can't enter Doze, otherwise the recording, navigating etc. app would also be stopped. So you can turn it off without side effects.

I use Tasker to do this. You can either tell Tasker to stop FD when some specific app is running or (this is what I do) as soon as you enable GPS.

---------- Post added at 07:59 PM ---------- Previous post was at 07:59 PM ----------

Sorry, got you wrong.
[Android Apps and Games] IronicChloride:
[MENTION=5427507]ssrij[/MENTION] when defining a delay before entering doze, why not edit the doze settings instead of holding a wakelock?
[Android Apps and Games] ssrij:
Because the delay is for ForceDoze and not for Doze. It has to do several things before putting your device into Doze, and won't be possible if the device has already entered Doze.
[Android Apps and Games] ianmacd:
Isn't that prevented by ForceDoze being whitelisted from Doze?
[Android Apps and Games] ssrij:
Well, whitelisting a package does not mean it's fully exempt from Doze. Whitelisting partially removes the restrictions from an app, so rest of the restrictions still apply to it. But that's not even the point, the point is, ForceDoze has to put your device into force-idle mode, which is different from the normal idle mode that Doze puts you in. If there's no wake lock, then ForceDoze will have no way to reliably wait until the normal idle mode kicks in, and after it does, there won't be any way at all to wait anyway and put the device into force-idle mode because the service will be put to sleep when the device enters Doze, and judging from user reports on this thread, the OS seems to do that before you even enter Doze mode.

I might have to change the wording of the setting, make it ForceDoze Delay rather than Doze Delay to avoid confusion.
[Android Apps and Games] beat s:
I'm on version 1.2 from the Google playstore on a mi4c with latest resurrection remix rom. Lost almost 5% battery in one hour. I'm not sure if it really goes to deep sleep as stated in the logfile...

Spotify for example doesn't stop when i turn off the screen even if it's not on the whitelist... ?
[Android Apps and Games] Sheikh Nadeem:
I can't access the settings menu.....:(
[Android Apps and Games] ajeesh vijayan:
doze delay

tried v 1.2

set doze delay 2min

turned off screen @5.50am

turned on after few seconds

continued using

suddenly network connection disabled

checked force doze stats

entered doze mode 5.52am

so delay doesn't turn off if we turn screen on between screen off and delay period

thank you
[Android Apps and Games] ssrij:
I pushed a new update today that should hopefully fix that issue. That usually happens when your device is about to enter Doze and you turn on the screen
[Android Apps and Games] ssrij:
I have pushed an update today that fixes that
[Android Apps and Games] ssrij:
You should look into the battery stats to see if some other app isn't draining your battery. That could be a Spotify issue, and not an issue with the app. Some apps can bypass Doze, like Spotify if you're playing the music in background. It happens on my phone as well, even when I am not using my own app
[Android Apps and Games] ajeesh vijayan:
you're great..will try latest
[Android Apps and Games] ssrij:
You can download the latest APK from the post instead of waiting for Play Store to update
[Android Apps and Games] ssrij:
I have pushed a new update now that should hopefully fix the background data issue
[Android Apps and Games] ssrij:
I have pushed a new update now that should prevent the service from accidentally enabling doze during screen on
[Android Apps and Games] ajeesh vijayan:
updated.. works fine.. thank you
[Android Apps and Games] optimummind:
So far so good on 1.2.1! Thx!
[Android Apps and Games] Sheikh Nadeem:
Yes and I have already given the root permissions.
[Android Apps and Games] ssrij:
So, you run the app, you see the SU authorisation dialog box, you click on Grant and grant the app SU access and then go to menu and Settings still not accessible? Can you check the logcat, the app will mention if you've properly granted it root and if the 'android.permission.DUMP' permission is granted.
[Android Apps and Games] ssrij:
This should be now fixed in v1.2.1 which is live on Play Store
[Android Apps and Games] ssrij:
This should now be fixed in v1.2.1 which is live on Play Store
[Android Apps and Games] jacomail95:
Great app i needed this :D

Inviato dal mio Nexus 4 con Tapatalk 2
[Android Apps and Games] kryshnakishore:
Thanks i am trying it, do ur best to improve

---------- Post added at 03:58 PM ---------- Previous post was at 03:54 PM ----------

Installed, looks simple, enabled it, is this app needed to be run in background or just enable & killing it will also work??
[Android Apps and Games] JoeFCaputo113:
Don't know how much work it'd be but can you please make a tasker plugin for this?! I'd love to be able to turn this on, but only between 12am-9am (when I'm sleeping). Thanks :good:
[Android Apps and Games] ianmacd:
I must admit to being somewhat confused by it myself.

I have a one minute delay configured, and I thought I was postponing Doze for one minute after the screen goes off. However, you seem to be saying that I'm actually postponing ForceDoze from performing some pre-Doze work. Is that correct?

And regarding the wakelocks, why does ForceDoze even wait for normal idle mode to kick in? Why doesn't it just force idle mode when the screen goes off (after observing any configured FD delay and/or lock-screen delay, of course)?
[Android Apps and Games] ssrij:
Yes, postponing it from doing some pre-Doze work and actually putting your device into force-idle mode. The whole point of ForceDoze is to put force your device into Doze immediately instead of waiting for a longer period of time and keep it there. If you just want Doze to kick in a little faster, you can achieve that by perhaps using Doze Settings Editor and modifying some of the relevant values. But that probably will make no difference if your device starts moving, the point at which Doze will exit.

That's what it does. Someone just asked why a wake lock is needed sometimes and I was just explaining. The wake lock is required to delay the pre-Doze work and to delay putting your device into force-idle mode. If there's no wake lock, there's no way to wait and delay the pre-Doze work and put your device into force-idle mode.
[Android Apps and Games] doiutzu:
This is my personal best.

It's much better since you introduced Wi-Fi and data toggle and since rev 36 doze exiting is reliable(100%) .

So thanks.

PS Can you put a donate version on Google Play? I don't use any other method of payment online and I would really like to donate for your work.
[Android Apps and Games] okij:
Basically you're right, but I have my track recording apps whitelisted, and so I would expect that they then can use GPS too.

Without ForceDoze, they work normally, simply because Doze doesn't kick in as long as the phone is moving.

IMHO it would be quite important that ForceDoze took care of this, simply because normal users don't know why their track recording suddenly stopped working and also don't know of and don't use tasker.

So I hope that [MENTION=5427507]ssrij[/MENTION] will implement some function or option that watches if GPS is turned on and then prevents the device from entering Doze. :)
[Android Apps and Games] ssrij:
You can achieve that using Tasker i.e disable ForceDoze when you run an app that uses GPS. I'll look for a workaround though
[Android Apps and Games] ssrij:
I might do that in the future. In the meantime, you can use the Donate To Me button below my name (or use this link) to Donate, this will take you to a special page to donate, where PayPal will also offer you an option to use your card instead of forcing you to log into PayPal.
[Android Apps and Games] ssrij:
Updates

I've heard positive news regarding the workaround to keep Doze active during movement without root or Xposed, so I am planning to make it the default behavior now, so the device will no longer touch the motion sensors or enable/disable it.

I'll be looking for a way to let apps use GPS during Doze, but I cannot promise a workaround. Most likely, even if I find one, I might not add it to the app if it has bad effect on battery, because there isn't a way to restrict GPS access to certain apps, so either all apps will be able to access it or none, and if apps can request location updates during Doze, then it will negate all the effects of Doze. The best way is to turn off ForceDoze manually or using Tasker when you're using apps like Google Maps, and re-enable after you're done using it. Investing a few minutes learning to use Tasker is definitely worth it in this case.

I don't think there's much stuff to fix/improve now, there are some rare/edge cases where things go wrong, but it's not of high priority. I will look into them sometime later.

I will be redoing the Doze stats section so it looks a little better and would provide some more useful stats. Apart from that, I guess the app is feature complete now and does not require more development. However, I will keep feature requests/ideas in mind and work on them if I find that they will be really useful to the users.
[Android Apps and Games] jobella:
[MENTION=5427507]ssrij[/MENTION] Thank you.

Although I didn't test the WiFi and Data turn on functionality, it appears that version 1.3.4 rev 38 works correctly on my LG G4. The experimental non-root disable motion sensing works fine.

I can control ForceDoze with Tasker but I haven't done much except disable and enable it.
[Android Apps and Games] ianmacd:
You say "make it the default", so I assume the old method of disabling the motion sensors will remain an option. Is that the case?
[Android Apps and Games] ssrij:
Nope, although I may bring it back later subject to users feedback regarding the new method.
[Android Apps and Games] ianmacd:
OK. I suppose my question was motivated by slight apprehension. I haven't tested the new, non-root method yet on my devices. The code has been in the app for only 24 hours and I know that the old method works, so I'm reluctant to see it disappear altogether.

Regarding the new method:

Is there really no downside to the device coming out of idle state, even just briefly? My concern is that this, in combination with the active motion sensors, is always going to use more power than the old method. Am I wrong?

It seems important to know not just that the new method works, but that it isn't significantly more expensive than the old method. And I wonder if there has been enough time to collect that data,

In any case, I will switch to the new method and observe how my devices respond.
[Android Apps and Games] ssrij:
Well, if it comes out of Doze mode, running services and apps will be able to do things normally, thus lower battery life. If you put the device back into Doze mode every time it comes out, apps won't be able to do that, and thus your device will effectively stay in Doze mode as long as the screen is off. Also, Doze doesn't constantly monitor device movement, it does that periodically, otherwise your battery will deplete faster trying to monitor movement all the time. So, the number of times ForceDoze will have to put your phone back into Doze will be limited. As far as I know, this shouldn't have any negative effect on battery.

I am making it default so I can get even more data. Right now, I only have confirmation from a handful of users.
[Android Apps and Games] ssrij:
Pushed a new update (1.3.5 rev 39) to Play Store (but feel free to grab the APK)

ForceDozeService: Completely removed sensor enabling/disabling functionality, replaced it with a non-root/non-Xposed workaround to reliably re-activate Doze on device movement

Persistent Notification: Replaced "Currently Dozing" stat (which was useless) with "Battery usage in last Doze session" stat, which will tell you how much battery was consumed in the last Doze session. I believe this would be a lot more useful

Whitelist: Added the ability to add/remove apps by package name

Whitelist: Some improvements to the way the whitelist is updated after adding/removing apps, should be more responsive

Doze Battery stats: Shows date/time in 24-hour format by default, should fix the issue where stats would show am/pm and also mess up the sorting.

Your old logs won't be accessible due to this change

Doze Battery stats: Fixed logs not getting cleared for some users
[Android Apps and Games] kryshnakishore:
Please update apk or revert to older one, present version is very unstable & draining battery too.. Chck my logs... Battery list 74 to 65 last night

https://mega.nz/#!qhsmDD5B!p9CrvUOtV4jCq8bY6SqWQziZ6yXXp1ROXGO0rhcEVIE

https://mega.nz/#!29tikZaA!5YcnM-yNfkk4jB45gY5uei-5bRg4ncr8GtrQgCaF4Lg

---------- Post added at 05:37 AM ---------- Previous post was at 05:36 AM ----------

What a timing thanks for pushing new one.. Pls do chck my logs above
[Android Apps and Games] ssrij:
A screenshot from GSAM showing the app's battery usage/impact would be much better. Also, open GSAM -> App Sucker -> ForceDoze -> Menu -> Export and post here
[Android Apps and Games] kryshnakishore:
I hate to use wakelock dectector, bbs, gsam apps which indeed runs in background. Anyway latest update will solve my issues I think.. I removed greenify app too after FD.. Pls upload in www.apkmirror.com so that it will reach more
[Android Apps and Games] Sheikh Nadeem:
Can't add apps in whitelist.
[Android Apps and Games] ssrij:
Can you explain more?
[Android Apps and Games] monza1412:
No problem here.
[Android Apps and Games] kryshnakishore:
I can't remove apps from white list like Google play Store, com.google.android.gms, com.google.providers.downloads
[Android Apps and Games] Baconrules21:
Yup having the same problem. On my S6, I have all the samsung services on there by default as well that I can not remove. Not sure why. I hope the developer doesn't leave it there passively.
[Android Apps and Games] anuraag.neo:
There seems to have problem with Whitelist apps. Sometimes it shows whitelisted apps sometimes not.
[Android Apps and Games] Sheikh Nadeem:
When i click on then '+' button on whitelist menu and add an app. It shows nothing in the list.
[Android Apps and Games] milojoseph:
Same
[Android Apps and Games] HowJesNo:
well here are results with forcedoze ON.

overnight forcedoze off was 8h50min 6% battery used. that's around 0.6-7% per hour.

with forcedoze ON 14hours 10% batery. that is again around 0.7% per hour.

is forcedoze not functioning on my S6??
[Android Apps and Games] ianmacd:
Those apps are system apps whitelisted by Android. The system Doze whitelist doesn't display (most of) them, however, to avoid clutter and confusion. ForceDoze, on the other hand, does display them.

You can't remove these apps from the Android whitelist and quite a few things would break if you could. com.google.android.gms, for example, is Google Play Services. If you check under System -> Applications (or in a battery stat app) to see which processes it comprises, you'll see just how much it's doing and why it can't simply be allowed to be put to sleep by Doze.
[Android Apps and Games] petr232:
You can check the logs to see if Doze was activated, but I think your results are normal since the only difference when using the app is Doze being activated 30 minutes earlier (which cannot make any measurable difference). You need to use your phone to see any change.
[Android Apps and Games] Arstoien:
You do realise that overnight comparison doesn't show any meaningful result? With or without ForceDoze, your device will be dozing, because it's not being used and it's not being moved. So realistically it should be the same result – which is what you're seeing.

Sent from my Nexus 5
[Android Apps and Games] Arstoien:
[MENTION=5427507]ssrij[/MENTION] one question – if I have a task in Tasker that waits for 5 min after "screen off" to enable FD service, and then disables it on "screen on", do you think that would negatively affect the battery life, and can you confirm that enabling the service (with ignore lockscreen timoseout) will make the device enter Doze immediatelly?

The reason I'm asking is because I'd like to keep the doze delayed without wakelocks, and Tasker is perfectly reliable for me in performing timed tasks on screen off. It could be that I've given it accessibility permissions. Which brings me to my other question:

Do you think requesting accessibility permission from the user won't keep the service from being stopped, and thus allow you to use delay without wakelock? Perhaps it's non-related but I thought I'd ask.

Also what happened to the idea of only disabling Doze's access to the motion detector, so we can safely tweak the Doze parameters and be sure Doze won't exit idle due to movement? If you need feedback from xposed, let me know how I can help, because that sounds like the best possible solution to xposed users.

Sent from my Nexus 5