1. Lock screen time
Lock screen time controlCodeLocation: frameworks/base/packages/settingsprovider/src/COM/Android/providers/settings/databasehelper. Java
Private void loadsystemsettings (sqlitedatabase dB ){
......
Loadintegersetting (stmt, settings. system. screen_off_timeout, R. Integer. def_screen_off_timeout );
......
Control Data in: Frameworks/base/packages/settingsprovider/RES/values/defaults. xml
<Integer name = "def_screen_off_timeout"> 60000 </Integer>
60000 is measured in milliseconds, that is, 1 minute. If it is set to-1, the screen is not locked. If this parameter is modified, the screen is still locked after the instance is started, and the screen is no longer locked after the instance is unlocked.
2. Disable lock screen upon startup
The boot screen lock code is located at: Frameworks/base/policy/src/COM/Android/Internal/policy/impl/keyguardviewmediator. Java
/**
* External apps (like the phone app) can tell us to disable the keygaurd.
*/
Private Boolean mexternallyenabled = true;
It can be seen that the screen is locked by default.
The following code is displayed when you search for this variable:
Public void setkeyguardenabled (Boolean enabled ){
Synchronized (this ){
If (Debug) log. D (TAG, "setkeyguardenabled (" + Enabled + ")");
Mexternallyenabled = enabled;
So you canProgramCall setkeyguardenabled to control the screen lock status.
3. Other settings related to lock screen
Pay attention to the Code in step 2 and you will find that many default parameters are set here.
For example:
/*** How long to wait after the screen turns off due to timeout before
* Turning on the keyguard (I. e, the user has this much time to turn
* The screen back on without having to face the keyguard ).
*/
Private Static final int keyguard_delay_ms = 5000;
If you press a button to activate the screen within five seconds after the backlight is disabled, you do not need to unlock it again.