How to change default display timeout settings using adb command ?

Connect your Android device over adb to get adb shell and check the default screen timeout value already set,

$ adb shell settings get system screen_off_timeout
30000

As you can see above for our android device the default screen timeout was set to 30 sec i.e. 30 * 1000 ms, now we can change this value to say 45 sec as,

$ adb shell settings put system screen_off_timeout 45000

The display information can be obtained using below command,

$ dumpsys power | grep Screen                                                                                                                                                                 
  mLastScreenBrightnessBoostTime=0 (3088734 ms ago)
  mScreenBrightnessBoostInProgress=false
  mSuspendWhenScreenOffDueToProximityConfig=false
  mDozeAfterScreenOff=true
  mMinimumScreenOffTimeoutConfig=10000
  mMaximumScreenDimDurationConfig=7000
  mMaximumScreenDimRatioConfig=0.20000005
  mScreenOffTimeoutSetting=45000
  mMaximumScreenOffTimeoutFromDeviceAdmin=900000 (enforced=true)
  mScreenBrightnessSetting=0
  mScreenBrightnessModeSetting=1
  mScreenBrightnessOverrideFromWindowManager=-1
  mDozeScreenStateOverrideFromDreamManager=1
  mDozeScreenBrightnessOverrideFromDreamManager=17
  mScreenBrightnessSettingMinimum=1
  mScreenBrightnessSettingMaximum=255
  mScreenBrightnessSettingDefault=102
Screen off timeout: 10000 ms
Screen dim duration: 2000 ms

As you can see above, if we change the “screen_off_timeout” to 45 sec, it changes as “mScreenOffTimeoutSetting=45000” as reported in dumpsys.

Related :   "adb shell getprop" - Gets an Android system property, or lists them all

Reference –

<integer name="def_screen_off_timeout">60000</integer>

as seen in frameworks/base/packages/SettingsProvider/res/values/defaults.xml#21 from http://androidxref.com/9.0.0_r3/xref/frameworks/base/packages/SettingsProvider/res/values/defaults.xml#21


lynxbee_ezoic

Subscribe with Valid Email Id to receive updates in Inbox. ( Secured by Google FeedBurner )

   


Leave a Comment

Android Android Applications Android Build system Android Commands Application Libraries Application Stack / User Interface Bash / Shell Scripts Bluetooth driver Cloud Technologies Commands and Packages Compilation Content Management System Core Kernel C Programs Development & Build Development, Debugging and Performance Tools Development Environment Setup Django & REST Api Errors & Failures Git Hardware Platforms HTML JAVA Programs Linux, OS Concepts and Networking Linux Device Drivers Linux Host, Ubuntu, SysAdmin Linux Kernel Linux Networking Middleware Libraries, HAL Multimedia Audio, Video, Images NDK / Middleware / HAL OS Concepts PHP Programming Languages Scripting and Automation Search Engine Optimisation ( SEO ) Social Media Source Code Management ( SCM ) System Administration, Security Testing and Debugging Uncategorized Web design and development Website Hosting Wordpress Yocto / Bitbake / Openembedded