I ran diffchecker on the adb system settings output with force 90hz enabled and disabled, and found the setting that switches when you activate "force 90Hz" in the developer settings: "min_refresh_rate=90.0". If you're rooted you can set that with Tasker based on whatever conditions you want, using the shell command function. The code to activate it is "settings put global min_refresh_rate 90.0", and the code to deactivate is "settings delete global min_refresh_rate" (both need "use root" ticked). I've been testing having it triggered on my phone when I'm connected to my home wifi and ambient light is < 15. The home wifi condition is so I don't run into big battery drains when I'm out late at night, and I'm using ambient light rather than screen brightness because as someone pointed out in a Reddit thread, Smooth Display will still run under 75% screen brightness under certain ambient lighting conditions. So far, battery is definitely taking a hit, but it's not a big deal when I'm home and chargers are in easy reach.
tardis_42 said:
I ran diffchecker on the adb system settings output with force 90hz enabled and disabled, and found the setting that switches when you activate "force 90Hz" in the developer settings: "min_refresh_rate=90.0". If you're rooted you can set that with Tasker based on whatever conditions you want, using the shell command function. The code to activate it is "settings put global min_refresh_rate 90.0", and the code to deactivate is "settings delete global min_refresh_rate" (both need "use root" ticked). I've been testing having it triggered on my phone when I'm connected to my home wifi and ambient light is < 15. The home wifi condition is so I don't run into big battery drains when I'm out late at night, and I'm using ambient light rather than screen brightness because as someone pointed out in a Reddit thread, Smooth Display will still run under 75% screen brightness under certain ambient lighting conditions. So far, battery is definitely taking a hit, but it's not a big deal when I'm home and chargers are in easy reach.
Click to expand...
Click to collapse
This is handy, thank you! Quick question though, how do you run an adb system settings output to see the difference when you switch other settings?
TheBobMiller said:
This is handy, thank you! Quick question though, how do you run an adb system settings output to see the difference when you switch other settings?
Click to expand...
Click to collapse
Assuming you have adb running and connecting to your phone fine already, it's pretty easy. Enter adb shell, then run three commands: "settings list global", "settings list system", and "settings list secure". Open up diffchecker.com and copy the results from the shell into one side. Change whatever setting you're interested in on your phone, then run these commands again and copy the output into the other side of the diffchecker window. It'll show you anywhere the output has changed, and that should be your setting - although there might be a couple other differences flagged, eg I think system uptime is in there somewhere.
tardis_42 said:
Assuming you have adb running and connecting to your phone fine already, it's pretty easy. Enter adb shell, then run three commands: "settings list global", "settings list system", and "settings list secure". Open up diffchecker.com and copy the results from the shell into one side. Change whatever setting you're interested in on your phone, then run these commands again and copy the output into the other side of the diffchecker window. It'll show you anywhere the output has changed, and that should be your setting - although there might be a couple other differences flagged, eg I think system uptime is in there somewhere.
Click to expand...
Click to collapse
Thank you so much! I'm not sure how I never knew this but being an avid Tasker user, I should've known this by now. This is gonna really come in so useful for me! Thank you!
How did you find this script <min_refresh_rate> ? Do you max to lock the maximum fps would be <max_refresh_rate>?
Small change to the command; in Android 11 beta 2.5, you have to use "settings put system min_refresh_rate 90.0". Changing the global flag does nothing to the frame rate anymore but changing the system value can force 90hz, even if you have smooth display turned off.
Trixter313 said:
Small change to the command; in Android 11 beta 2.5, you have to use "settings put system min_refresh_rate 90.0". Changing the global flag does nothing to the frame rate anymore but changing the system value can force 90hz, even if you have smooth display turned off.
Click to expand...
Click to collapse
Thank you!
I have been looking for this since beta 2 came out ?
Related
Hi. This is a question for a rooted Droid /Milestone, but should be applicable to other models as well. I'd like to know if there's a command or any other functionality I can use to "lock" the brightness setting so that other applications can't change it.
I know it's possible, because there's an app in the Market called AdjBrightness (looks like the developer posts here, as well) that is capable of locking it, but I don't quite need all the functionality it provides, and I can't work out how to reverse its home row backlight disabling, which means I ALSO have to run LEDs Hack... I'd like to just write something simple for my specific settings to replace both.
I'm trying to create a very short script I can run with Tasker and set to a widget that will accomplish 3 things: Disable the home row backlights, set the brightness to 2/255, and then "lock" that setting so that other apps can't affect it. I want to run Aldiko for reading in pretty much total darkness, and this is the ideal setting for me.
So far, I can get it set properly using the following:
su
echo 2 > /sys/class/leds/lcd-backlight/brightness
echo 0 > /sys/class/leds/button-backlight/brightness
and with Tasker I can run that as a script and set it to a widget, with another widget to complement it that runs:
su
echo 100 > /sys/class/leds/lcd-backlight/brightness
echo 1 > /sys/class/leds/button-backlight/brightness
which reverses the process and sets everything back to normal.
What I need is to figure out how to lock in that "2" brightness setting, which at this time persists only until some other app affects the brightness. When I run Aldkio, its built-in brightness control feature overrides my setting and lights the thing back up too bright.
So, can this be done with a script? I imagine a chown command that temporarily takes ownership of that function could work, but I'm not smart enough to know how, and I've exhausted Google and the forum search. As I mentioned, this thing would always be run with a complimentary script that could later reverse the chown and give it back to whatever process it ought to belong to... I KNOW it's possible because there's at least one app that does it perfectly; the AdjBrightness setting change persists after I open Aldiko, indeed it persists basically forever; you've got to kill the app or reboot to be able to adjust the brightness with any other means.
Can anyone point me in the right direction?
Bump? Still trying to figure this out.
Bump
Still wondering if there's a way to do this.
+ 1 - if you find a way to lock it via command line, do post back, as will i
i am currently using adjbrightness it to control my button backlights on my dell streak
its great as it locks it on for that session. but after reboot have to manually renable
so i have written an execute entry in tasker to control all or just some of the leds for various notifications
but would love a command line way to lock these as adjbrightness does, i cant find out how its doing that!!!
jdb1981 said:
Hi. This is a question for a rooted Droid /Milestone, but should be applicable to other models as well. I'd like to know if there's a command or any other functionality I can use to "lock" the brightness setting so that other applications can't change it.
I know it's possible, because there's an app in the Market called AdjBrightness (looks like the developer posts here, as well) that is capable of locking it, but I don't quite need all the functionality it provides, and I can't work out how to reverse its home row backlight disabling, which means I ALSO have to run LEDs Hack... I'd like to just write something simple for my specific settings to replace both.
I'm trying to create a very short script I can run with Tasker and set to a widget that will accomplish 3 things: Disable the home row backlights, set the brightness to 2/255, and then "lock" that setting so that other apps can't affect it. I want to run Aldiko for reading in pretty much total darkness, and this is the ideal setting for me.
So far, I can get it set properly using the following:
su
echo 2 > /sys/class/leds/lcd-backlight/brightness
echo 0 > /sys/class/leds/button-backlight/brightness
and with Tasker I can run that as a script and set it to a widget, with another widget to complement it that runs:
su
echo 100 > /sys/class/leds/lcd-backlight/brightness
echo 1 > /sys/class/leds/button-backlight/brightness
which reverses the process and sets everything back to normal.
What I need is to figure out how to lock in that "2" brightness setting, which at this time persists only until some other app affects the brightness. When I run Aldkio, its built-in brightness control feature overrides my setting and lights the thing back up too bright.
So, can this be done with a script? I imagine a chown command that temporarily takes ownership of that function could work, but I'm not smart enough to know how, and I've exhausted Google and the forum search. As I mentioned, this thing would always be run with a complimentary script that could later reverse the chown and give it back to whatever process it ought to belong to... I KNOW it's possible because there's at least one app that does it perfectly; the AdjBrightness setting change persists after I open Aldiko, indeed it persists basically forever; you've got to kill the app or reboot to be able to adjust the brightness with any other means.
Can anyone point me in the right direction?
Click to expand...
Click to collapse
In my device adjbrightness app lock the brightness just by changing the permission of "/sys/.. /brightness" file to 444. So even system can't change the brightness value if requested by any other apps. To unlock the brightness permission of "/sys... /brightness" is restored to previous state, 644.
So in terminal the commands can be "for changing brightness to 2 and lock it"
su
echo 2>/sys/class/leds/lcd-backlight/brightness
chmod 444 /sys/class/leds/lcd-backlight/brightness
"for unlock and restore "
su
chmod 644 /sys/class/leds/lcd-backlight/brightness
echo 100> /sys/class/leds/lcd-backlight/brightness
Same goes for button backlight brightness file
But I found it "not suitable" for my device even with adjbrightness. If I lock brightness using adjbrightness after my screen turns off normally or by using power button , I can't turn it on using power button, so I have to open the battery and reboot the device. Same thing happens if I do it using "commands" or script. So "something" should be done so that the permission of ".. /brightness" file is set to 644 before the screen turns off normally or by other means.And after the screen is on the file permission will be 444 again. I think it may be done using tasker but still don't know how.
Hope someone will help.
Thanks.
Hi
I am not sure why, but I can't turn off screen, with "echo 0 >" into brightness.
It seems that there is some minimum brightness somewhere which I need to configure ?
I really struggle with it.
Any idea how to do that ?
Thanks,
Ranchu
Please note, you do these at your own risk, I am not responsible for anything breaking!!
Set your wallpaper to an all black wallpaper, this will save your battery some-what. Turn on adaptive brightness THEN turn your screen brightness all the way down. Turn on battery saver. Enable "DND" and set it to complete silence, you'll still get calls and texts. If you're rooted and want to change your display dentisy, do this:
*needs to be rooted*
Download build prop editor from the play store, grant permissions with SuperSU, edit, go to the bottom of the list and add this:
ro.sf.lcd_density=380
Save the file, close the app, open the app and reboot. Congratulations, your DPI has now been changed.
Go in to your sound and disable all sound in other, change your ring tone and notification to none. Disable sound for media, notification and ring tone.
Enable developer options, turn ON HW overlay. disable all animations to 0. Show all ANR's and background processes to no background apps.
Download BBS FROM HERE (XDA) and wakelock detector, you'll see what is consuming your battery. AMPERE will also tell you your charge rate and discharge rate, very good app.
Go in to your apps, disable everything you're not going to use, movies, music etc. BLOCK notifications for apps you don't want. change your permissions on your apps if you wish to do so.
You can check your battery's capacity with "kernel auditor" and you can underclock your CPU thus saving battery and it doesn't really effect performance.
Turn off vibration, disable account auto syncing, disable now on tap, go in to your Google settings, security and disable all, phone search and disable all. Date and time, disable automatic date and time, set to NOT 24 hours time display.
If you want to root:
Boot TWRP from here:
https://twrp.me/devices/motorolamotog2016.html
Make sure you have your Motorola drivers if you're on windows and fastboot, if you're on Linux (which I am) do this:
"sudo apt-get install android-tools-adb android-tools-fastboot"
You have developer options enabled, enable USB debugging and accept on your phone for auth.
BOOT in to twrp:
adb reboot bootloader
fastboot boot yourdir/twrp-3.0.2-0-athene.img
Wipe your phone, MAKE SURE to have a backup. Create your SuperSU file:
TWRP > Advanced > Terminal and type: "echo "SYSTEMLESS=true" > /data/.supersu" HIT enter, go to: TWRP > Advanced > File Manager and look for your SuperSU file.
Install your SuperSU Stable from here:
https://download.chainfire.eu/969/SuperSU/UPDATE-SuperSU-v2.76-20160630161323.zip
Make sure it's on your SDCARD. install. Nice, you're rooted.
If you want to install A CUSTOM kernel, download here:
http://forum.xda-developers.com/moto-g4-plus/development/kernel-elementalx-g4-0-01-t3424836
MAKE SURE it's on your SD card, install. nice.
*!!you will lose your official status!!*
Post your tips and tricks here.
*ROOTING is systemless, you will not lost your official status. IF you install the kernel, your official status will BE GONE!!!!*
bwoiisc0tty said:
Set your wallpaper to an all black wallpaper, this will save your battery some-what. Turn on adaptive brightness THEN turn your screen brightness all the way down.
Click to expand...
Click to collapse
I disagree with this. We have an IPS LCD display. Which means that keeping a black screen INCREASES power consumption, because of the way LCD screens work. This would work wonders for an LED screen, but for our phone, keep the colour towards the whiter sides & keep the brightness low.
Buying 15000rs (225$) and you are telling us to disable all the features and not to use..Should I laugh or ignore ? This is not the right way to tell tricks & tips.
#chill
When i try to change my DPI to 380 or 400....
It breaks my camera...
Camera becomes non-responsive, en doesn't give an image anymore....
Only way to fix it again is to do a restore of my ROM.
coolhead said:
When i try to change my DPI to 380 or 400....
It breaks my camera...
Camera becomes non-responsive, en doesn't give an image anymore....
Only way to fix it again is to do a restore of my ROM.
Click to expand...
Click to collapse
Working fine with 400dpi, non rooted device
Sent from my Moto G (4) using XDA-Developers mobile app
I agree that a black background helps on the MotoX 1st gen that has OLED screen, but will not do anything for our LCD screen.
As for keeping at the minimum the apps that run in background, that's good advice. Everyone can decide if those aps are important to them.
I just got a Fire HD 10 9th gen, and I can't root it, so unfortunately I could not install f.lux. I did some googling and it turns out you can turn on androids built in night mode instead with an ABD shell command, I have no idea why Amazon makes you use their crappy blue light filter, which is really just an overlay. So anyways,
1. Plug your Fire HD into your computer
2. Start an ABD shell (I use Fire Toolbox to do this easily)
3. Paste these two commands, one at a time:
"settings put secure night_display_activated 1"
"settings put secure night_display_auto_mode 1"
4. Open settings on your Fire HD, it should say night mode is enabled at the top, click this to change the schedule to sunset to sunrise or to any time range you want.
5. Use your Fire HD at night without being blinded or washing out your screen with amazon's crappy filter.
Thanks, the default night mode is so much better than the Blue shade filter crap they put in.
Oh NightLight does NOT show up on Screenshots!
But yes. it is indeed VERRY much better.
Thanks a lot.
So, the "night mode" in settings isn't shown after reboot? Do we have to run the adb commands every time we want to make changes?
If you leave it on "Automatic" it will show up again at night!
jcp2 said:
So, the "night mode" in settings isn't shown after reboot? Do we have to run the adb commands every time we want to make changes?
Click to expand...
Click to collapse
There isn't a "night mode" setting enabled there. But if you go to settings after pushing those adb commands and go in to settings, there will be a drop down from the top that says something like night mode is enabled. You can click that and set the time to activate it.
any way to make to stick it permanently even when rebooted and messed with? is there way to write these as init when I boot the FireHD?
If you're using Nova Launcher you can simply add a Widget -> Nova Activity.
Go to Settings and select .Settings$NightDisplaySuggestionActivity and you have a shortcut to the settings on the Main screen.
123nate said:
I just got a Fire HD 10 9th gen, and I can't root it, so unfortunately I could not install f.lux. I did some googling and it turns out you can turn on androids built in night mode instead with an ABD shell command, I have no idea why Amazon makes you use their crappy blue light filter, which is really just an overlay. So anyways,
1. Plug your Fire HD into your computer
2. Start an ABD shell (I use Fire Toolbox to do this easily)
3. Paste these two commands, one at a time:
"settings put secure night_display_activated 1"
"settings put secure night_display_auto_mode 1"
4. Open settings on your Fire HD, it should say night mode is enabled at the top, click this to change the schedule to sunset to sunrise or to any time range you want.
5. Use your Fire HD at night without being blinded or washing out your screen with amazon's crappy filter.
Click to expand...
Click to collapse
I tried this on a Samsung Galaxy Tab S8 running Android 12. The display went dark, and luckily I quickly set the first command to 0 instead of 1
When I did the 2nd command, it did nothing, but I'm worried the screen will stop showing anything later tonight if it's based off of automatically turning on at sunset.
I'm wondering if you know a way to do this now, for example maybe adjusting the Night Light settings?
The built in version on Samsung's tablet, which has an LCD display, is awful. No such problem with OLED or AMOLED displays.
https://www.reddit.com/r/GalaxyTab/comments/mu8m5a
That is a link explaining my problem in detail
I am thinking I am halfway there because running
settings put secure night_display_activated 1
Makes the display go dark and changing it to 0 or any other number like 2 or 3 switches it back to working.
I also tested both commands on my Pixel 6 Pro running Android 12 and they work perfectly.
running the second command as 2 or 3 picks either set times to automatically turn on or from sunset to sunrise.
I just need to try modifying the Night Light to be anything other than black
When I run the command, it changes the filter to black, because the screen stays on, and I can tell it's still on because the LCD shows light through a black screen
Yeah, the "eye care" mode is such stupid naive implementation of Samsung LCD tablets. And they also don't let you change the color temperature in the display settings like on Samsung AMOLED devices.
You can change to vivid or natural but no color temperature.
All the thridparty apps use this stupid trick with the color overlay because a app is not able to change the display calibration settings.
BUT Samsung should know better and change the screen color calibration to get the low blue light effect.
They are root users and should have the know how for their devices.
Because vivid and natural also changes the screens color calibration, they should be able to so instead of this stupid orange overlay.
With the extra dim mode I could not find out if they also simply put on a gray overlay or reduce correctly the led backlight to a minimum. But according to their stupid design choices and thinking the customer is dumb and will not notice, this is maybe also a gray overlay.
People are complaining for 2 years now, starting with the Tab S7!
If somebody also thinks that this is a dumb implementation please report this issue to Samsung: e.g. https://www.samsung.com/us/support/contact/
I am not responsible for anything you do to your device.
Hello everyone at XDA, today I have prepared for you a way to turn your RM3S display from 90hz alternating, to a locked 120hz or 144hz. Possibly rm3 as well, I do not have mine on hand at the moment but i dont see why not.
Reason why?
Locking the screen to 90hz+ increases visual fidelity in programs locked to 60hz that suffer from a green tint, these programs will now run in 90,120, or 144hz.
Issues:
I have had no issues or problems with this tweak, it also survives a reboot.
Use long version if you have no root.
For those technically inclined here is the short version :
1.Change db_screen_rate in the system tables
Values: "0" 60hz locked "1" 90hz alternating "2" 120hz locked "3" 144hz locked
The value is the number itself nothing else.
Long version :
1.Download setedit main branch, known as "Settings Database Editor" on apkmirror. You can skip step 2 if you download the foss fork by MuntashirAkon, the app will tell you if you cant.
2. In adb on your pc OR in a ROOT SU TERMINAL, give setedit the permissions with the command it displays on the screen.
3. After giving it the neccasary permissions it should work right away but a restart of the app will make sure it does.
4. Go to the system tables section and scroll down until you reach
db_screen_rate
5. Click it, and click edit value, and use the value of your choosing from the above 1-4.
6. Profit.
FAQ
1.The setting isnt there?
Answer: You can add it yourself and it will still work
These refresh rates are natively supported by the display panel on the rm, they are however hidden to push advertising for newer devices with higher refresh rates stock OR to increase the longevity of your panel. I have experienced no negative effects however.
OR
The value isnt changed only whats visible, this requires testing in slow motion next to a 144z display, regardless this does enable 60hz apps to run in the higher refresh rate and have no tints or fidelity loss.
Do I need root for this?
souma_rox said:
Do I need root for this?
Click to expand...
Click to collapse
For the long version it is doable with just a pc and adb. No need for root .
Isn't that hardware screen not only software?
Needs testing next to a 144hz device in slow motion to confirm full compatibility, however all the other benefits are confirmed working.
RZaR2001 said:
Isn't that hardware screen not only software?
Click to expand...
Click to collapse
I would love to try this on my RM3 (non root Global ROM) but I am afraid after changing this setting it will cause my device to not usable as I only have one daily driver.
lius90 said:
I would love to try this on my RM3 (non root Global ROM) but I am afraid after changing this setting it will cause my device to not usable as I only have one daily driver.
Click to expand...
Click to collapse
People have told me the setting doesnt show for RM3, likely that the panel isnt 100% the same as RM3S, can you confirm the setting is there for you?
fps still show on 92fps with game booster after changed value to "2" or "3"
never00miss said:
fps still show on 92fps with game booster after changed value to "2" or "3"
Click to expand...
Click to collapse
What gane are you playing?
Hey xda-Community!
I recently wanted to reduce my idle drain and searched for ways to edit Android Doze settings, because I remembered seeing a tutorial that said you can change deviceidle-constants, that dictate how Doze works (how fast it kicks in, how long it kicks in, light/deep doze).
I tried all those old tutorials, but I quickly realized the old ways to change the parameters are deprecated, so I asked people on android.stackexchange.com and someone actually gave me the answer (thanks Andrew) (https://android.stackexchange.com/questions/247680/is-device-idle-constants-deprecated-in-android-12).
This works from Android 12 on and is achieved using a shell.
Commands:
Note: When using an adb shell, you have to put "adb shell" before those commands. I'll just put the bare commands here, you add what you have to add.
Checking the settings:
You can check your current Doze settings (and statistics) with "dumpsys deviceidle".
Changing a setting;
Every parameter has to be set individually. It's not that bad tho, as you only have to do this once.
Syntax is: "device_config put device_idle [KEY] [VALUE]".
One example: "device_config put device_idle light_after_inactive_to 30000"
You can check "dumpsys deviceidle" to see what keys there even are. To help you out, here's an explanation of what each key actually sets. You can also get a visual sense of how the light mode and the deep mode work (not my work, thanks to easz from github).
Spoiler: My recommended settings
First; reset parameters with: "device_config reset trusted_defaults device_idle"
light_after_inactive_to 30000
light_pre_idle_to 120000
light_idle_to 300000
light_idle_factor 2
light_max_idle_to 900000
light_idle_maintenance_min_budget 30000
light_idle_maintenance_max_budget 180000
inactive_to 900000
sensing_to 0
locating_to 0
motion_inactive_to 0
idle_after_inactive_to 900000
idle_pending_to 60000
max_idle_pending_to 120000
idle_pending_factor 2
idle_to 900000
max_idle_to 21600000
idle_factor 2
wait_for_unlock true
I also wrote a windows batch script (works via adb, you have to rename the .txt file to .bat) and a bash file that changes the parameters to my recommendations. See attachments.
will these settings persists even after a reboot? or upgrading rom?
maxs8007 said:
will these settings persists even after a reboot? or upgrading rom?
Click to expand...
Click to collapse
yes, these will stick after a reboot. Not sure about upgrading, but I would guess that it'll stay, because we don't actually modify anything on the system partition
@Doomkopf for me those settings won't stick.
For testing purpose I just applied those yesterday morning:
adb shell device_config put device_idle motion_inactive_to 300000
adb shell device_config put device_idle light_after_inactive_to 180000
This morning they are back to stock values. Any ideas? :S
Utini said:
@Doomkopf for me those settings won't stick.
For testing purpose I just applied those yesterday morning:
adb shell device_config put device_idle motion_inactive_to 300000
adb shell device_config put device_idle light_after_inactive_to 180000
This morning they are back to stock values. Any ideas? :S
Click to expand...
Click to collapse
I set mine like 6 weeks ago, it's still set. I miss many information, what phone do you use, what ROM, how you check if it's still set etc
Doomkopf said:
I set mine like 6 weeks ago, it's still set. I miss many information, what phone do you use, what ROM, how you check if it's still set etc
Click to expand...
Click to collapse
Hi, oh well here are some more infos:
Pixel 6 Pro
Latest Android 13 Stock ROM
Kirisakura Kernel
I check via "adb shell dumpsys deviceidle".
I set it all your settings on friday and today (monday) there are back to stock values.
Previously I tried settings my own settings on wednesday morning and had stock values on the next day already as well :S
Utini said:
Hi, oh well here are some more infos:
Pixel 6 Pro
Latest Android 13 Stock ROM
Kirisakura Kernel
I check via "adb shell dumpsys deviceidle".
I set it all your settings on friday and today (monday) there are back to stock values.
Previously I tried settings my own settings on wednesday morning and had stock values on the next day already as well :S
Click to expand...
Click to collapse
That doesn't sound good I'd check right after setting it, so you can see if it was changed at all (which I assume). If it indeed gets set and unset again, you could check this github repo (https://github.com/easz/doze-tweak) at "Caveat".
Those values got reset in the past already, but as it didn't happen to me, I thought Google stopped doing that. Maybe that old workaround still works Otherwise, you'll have to flash a custom rom I guess xD
EDIT: I also recommend looking at values easy to distinguish. For example, "sensing_to" and "locating_to" were nonzero before, now they are zero (for me), so these values are easy to compare for me. The values you need to look at are at the most upper part of the output, but I guess you already knew that
Doomkopf said:
That doesn't sound good
Click to expand...
Click to collapse
Did you ever mess with any other settings using device_config before? Like the number phantom processes, empty or cached processes, ActivityManager tweaks or anything else? Because I assume you did (and using Android 10 or higher) and disabled the settings sync back to the defauls.
Did you ever use the below command?
device_config set_sync_disabled_for_tests persistent
What does the below commands says?
device_config is_sync_disabled_for_tests
Perhaps it says true? If yes that's why your settings aren't changing.
crok.bic said:
Did you ever mess with any other settings using device_config before? Like the number phantom processes, empty or cached processes, ActivityManager tweaks or anything else? Because I assume you did (and using Android 10 or higher) and disabled the settings sync back to the defauls.
Did you ever use the below command?
device_config set_sync_disabled_for_tests persistent
What does the below commands says?
device_config is_sync_disabled_for_tests
Perhaps it says true? If yes that's why your settings aren't changing.
Click to expand...
Click to collapse
You quoted the wrong man
@Utini How'd it work out? If my last response doesn't help, maybe this one helps u
Doomkopf said:
You quoted the wrong man
@Utini How'd it work out? If my last response doesn't help, maybe this one helps u
Click to expand...
Click to collapse
No, logically I quoted the correct man Just wanted to indirectly tell others about the above trick / setting
Doomkopf said:
Hey xda-Community!
I recently wanted to reduce my idle drain and searched for ways to edit Android Doze settings, because I remembered seeing a tutorial that said you can change deviceidle-constants, that dictate how Doze works (how fast it kicks in, how long it kicks in, light/deep doze).
I tried all those old tutorials, but I quickly realized the old ways to change the parameters are deprecated, so I asked people on android.stackexchange.com and someone actually gave me the answer (thanks Andrew) (https://android.stackexchange.com/questions/247680/is-device-idle-constants-deprecated-in-android-12).
This works from Android 12 on and is achieved using a shell.
Commands:
Note: When using an adb shell, you have to put "adb shell" before those commands. I'll just put the bare commands here, you add what you have to add.
Checking the settings:
You can check your current Doze settings (and statistics) with "dumpsys deviceidle".
Changing a setting;
Every parameter has to be set individually. It's not that bad tho, as you only have to do this once.
Syntax is: "device_config put device_idle [KEY] [VALUE]".
One example: "device_config put device_idle light_after_inactive_to 30000"
You can check "dumpsys deviceidle" to see what keys there even are. To help you out, here's an explanation of what each key actually sets. You can also get a visual sense of how the light mode and the deep mode work (not my work, thanks to easz from github).
Spoiler: My recommended settings
First; reset parameters with: "device_config reset trusted_defaults device_idle"
light_after_inactive_to 30000
light_pre_idle_to 120000
light_idle_to 300000
light_idle_factor 2
light_max_idle_to 900000
light_idle_maintenance_min_budget 30000
light_idle_maintenance_max_budget 180000
inactive_to 900000
sensing_to 0
locating_to 0
motion_inactive_to 0
idle_after_inactive_to 900000
idle_pending_to 60000
max_idle_pending_to 120000
idle_pending_factor 2
idle_to 900000
max_idle_to 21600000
idle_factor 2
wait_for_unlock true
I also wrote a windows batch script (works via adb, you have to rename the .txt file to .bat) and a bash file that changes the parameters to my recommendations. See attachments.
Click to expand...
Click to collapse
Hi, currently I am using Naptime by Franco with ADB permissions. I'm not sure, but it should work by using the following options (maybe not only these, but I don't know well if there are other places where Doze options are stored):
inactive_to=2592000000,
motion_inactive_to=2592000000,
light_after_inactive_to=0,
light_pre_idle_to=30000,
light_max_idle_to=86400000,
light_idle_to=43200000,
light_idle_maintenance_max_budget=30000,
light_idle_maintenance_min_budget=10000,
min_time_to_alarm=60000,
min_light_maintenance_time=10000,
wait_for_unlock=0,
quick_doze_delay_to=86400000
It's working very well (I get 2% drain in 8 hours of sleep), but I wanted to try and improve it further, because the App tells you when and how much Doze is enforced and when maintenances are performed.
In my case, from my understanding, I don't need maintanances so often, or maybe I don't need it at all, because all the apps of which I need notifications are in non-optimized battery mode.
For reference, during night it performs 4-6 maintenances circa.
Coming to the point, I wanted to ask you I can use you settings even if they have further options like:
sensing_to 0
locating_to 0
and if I can make your settings even more extreme on some values.
For further reference, I have disabled through adb the "motion_engine", any system gesture and I have the Location always disabled (through UI shortcut, not ADB or advanced options).
NovaProspekt70 said:
Hi, currently I am using Naptime by Franco with ADB permissions. I'm not sure, but it should work by using the following options (maybe not only these, but I don't know well if there are other places where Doze options are stored):
inactive_to=2592000000,
motion_inactive_to=2592000000,
light_after_inactive_to=0,
light_pre_idle_to=30000,
light_max_idle_to=86400000,
light_idle_to=43200000,
light_idle_maintenance_max_budget=30000,
light_idle_maintenance_min_budget=10000,
min_time_to_alarm=60000,
min_light_maintenance_time=10000,
wait_for_unlock=0,
quick_doze_delay_to=86400000
It's working very well (I get 2% drain in 8 hours of sleep), but I wanted to try and improve it further, because the App tells you when and how much Doze is enforced and when maintenances are performed.
In my case, from my understanding, I don't need maintanances so often, or maybe I don't need it at all, because all the apps of which I need notifications are in non-optimized battery mode.
For reference, during night it performs 4-6 maintenances circa.
Coming to the point, I wanted to ask you I can use you settings even if they have further options like:
sensing_to 0
locating_to 0
and if I can make your settings even more extreme on some values.
For further reference, I have disabled through adb the "motion_engine", any system gesture and I have the Location always disabled (through UI shortcut, not ADB or advanced options).
Click to expand...
Click to collapse
Hey; please don't quote the whole post, it doesn't really tell me anything
I don't really understand: What do you want to know from me/what is your question? ^^
Yes, you can make some values more extreme, but you said you already did (less maintenance, more idle)
Doomkopf said:
Hey; please don't quote the whole post, it doesn't really tell me anything
I don't really understand: What do you want to know from me/what is your question? ^^
Yes, you can make some values more extreme, but you said you already did (less maintenance, more idle)
Click to expand...
Click to collapse
Hey, I'm really sorry, I'm new on XDA.
I wanted to know why you have some options valued that I don't, like for example:
light_idle_factor 2
sensing_to 0
locating_to 0
and if using them might improve even more my doze.
Also, even if I have Naptime installed, which already improved things by a lot, I wanted to know if some of my values could be improved further to avoid useless maintenances (like I said I have between 4 and 6 maintenances during night, but I barely need 1).
NovaProspekt70 said:
Hey, I'm really sorry, I'm new on XDA.
I wanted to know why you have some options valued that I don't, like for example:
light_idle_factor 2
sensing_to 0
locating_to 0
and if using them might improve even more my doze.
Also, even if I have Naptime installed, which already improved things by a lot, I wanted to know if some of my values could be improved further to avoid useless maintenances (like I said I have between 4 and 6 maintenances during night, but I barely need 1).
Click to expand...
Click to collapse
Doomkopf said:
You can check "dumpsys deviceidle" to see what keys there even are. To help you out, here's an explanation of what each key actually sets. You can also get a visual sense of how the light mode and the deep mode work (not my work, thanks to easz from github).
Click to expand...
Click to collapse
I linked a xda post that explains every value in detail (first link in second quote/my post);
locating_to and sensing_to: By the pictures (also in second quote/my post), you can see how deep doze works; before going into IDLE mode of deep doze, it goes through a sensing phase (motion detection starts) and locating phasing. Default behavior of doze is to not go sleep when you move the device. This skips this phase (time for detecting motion with sensor is 0). Same with locating; when android notices that you move the device (train, car, ...) via gps (or wifi triangulation, etc) it doesn't go to sleep. This also skips that phase
light_idle_factor 2: This multiplies light_idle_to with 2 everytime if goes thorugh a idle/maintenance cycle until it reaches light_max_idle_to. So this basically doubles your light idle time every cycle until it reaches a max duration (which you can set, I also did in my recommended settings)
In that overview you could also think about how to tweak your values so you get less maintenances during night, as you wanted. Basically you have to make both (deep and light) idle_to's longer. I recommend to increase light idle_to first (more light idle, less maintenance), before going too deep on deep sleep - sometimes your phone needs to do backups at night, etc. Dont be afraid to set a "too large" maintenance window, your phone won't suddenly start to draw much power for nothing. You just have a few seconds/minutes less deep sleep (which is ok, little percentage). Give it something like 2 minutes per night, if you're afraid a backup will take longer, you can even go for 3-4 minutes per night.
Doomkopf said:
I linked a xda post that explains every value in detail (first link in second quote/my post);
locating_to and sensing_to: By the pictures (also in second quote/my post), you can see how deep doze works; before going into IDLE mode of deep doze, it goes through a sensing phase (motion detection starts) and locating phasing. Default behavior of doze is to not go sleep when you move the device. This skips this phase (time for detecting motion with sensor is 0). Same with locating; when android notices that you move the device (train, car, ...) via gps (or wifi triangulation, etc) it doesn't go to sleep. This also skips that phase
light_idle_factor 2: This multiplies light_idle_to with 2 everytime if goes thorugh a idle/maintenance cycle until it reaches light_max_idle_to. So this basically doubles your light idle time every cycle until it reaches a max duration (which you can set, I also did in my recommended settings)
In that overview you could also think about how to tweak your values so you get less maintenances during night, as you wanted. Basically you have to make both (deep and light) idle_to's longer. I recommend to increase light idle_to first (more light idle, less maintenance), before going too deep on deep sleep - sometimes your phone needs to do backups at night, etc. Dont be afraid to set a "too large" maintenance window, your phone won't suddenly start to draw much power for nothing. You just have a few seconds/minutes less deep sleep (which is ok, little percentage). Give it something like 2 minutes per night, if you're afraid a backup will take longer, you can even go for 3-4 minutes per night.
Click to expand...
Click to collapse
Thank you very much, very helpuful!!
Based on your information, I think I understand better how Naptime works. It increases the parameters of Light Doze making them similar to those of Deep Doze, and also increases the duration.
Wouldnt it be easier to just create a routine or mode ?
Like when I am around my work place I have set it to turn wifi off so it dont keep scanning for wifi and stuff.
I personally feel with Samsung most things can be controlled within their phone and developer settings and not to mention their add on apps like Good Guardian and Good lock.
tfn said:
Wouldnt it be easier to just create a routine or mode ?
Like when I am around my work place I have set it to turn wifi off so it dont keep scanning for wifi and stuff.
I personally feel with Samsung most things can be controlled within their phone and developer settings and not to mention their add on apps like Good Guardian and Good lock.
Click to expand...
Click to collapse
I do use Samsung Routines to Enable Offline Mode and Battery Saving at night, which along with Naptime gives me 2% used battery in 8 hours over night, but during the day I can't find a good usage for it.
tfn said:
Wouldnt it be easier to just create a routine or mode ?
Like when I am around my work place I have set it to turn wifi off so it dont keep scanning for wifi and stuff.
I personally feel with Samsung most things can be controlled within their phone and developer settings and not to mention their add on apps like Good Guardian and Good lock.
Click to expand...
Click to collapse
I don't know what it would be easier as; this method?
This basically just configures doze to better fit your needs. It already had values in it before and it was activated before. You can (and should) do all this and still create a routine or mode additionally.
Doze is android's main internal battery saving feature, so tweaking it goes a long way.