'Is there a way to use adb to force android to not timeout the lock screen?

I've been using a special keyboard (the messageEase keyboard) to type in my really long password to get in, and it works well enough, but when I try to use the default keyboard I type slower, and the lock screen will go to black before I'm done typing in my password. Is there a way to stop the lock screen from switching to black, or at least change the time on it to something much longer? There's nothing in the settings for this, and I've tried using the settings command and I can't find anything that seems to work.

I'm using a Samsung Galaxy A32 5G with android 11.



Solution 1:[1]

On my device I have found that there is a "Standby intelligent power saving" setting under Battery Settings that needs to be turned off for the lock screen timeout to match the system screen timeout. This setting may go by a slightly different name on other devices. It can be toggled over adb like so:

adb shell settings put system background_power_saving_enable 0

Once this is done, you can use adb to modify the screen timeout time:

adb shell settings put system screen_off_timeout [value]

Where [value] is the amount of time in milliseconds before the screen will go to sleep. Note that this is identical in function to the sleep time setting in Display Settings.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Alsch