From: http://rootfs.wordpress.com/2010/07/23/android-enable-home-screen-lock-and-home-key/
The lock pattern does not take effect after setting. And the home key does not work.
1. Frameworks/base/policies/phone/COM/Android/Internal/policy/impl/keyguardviewmediator. java.
In private void dokeyguard () routine:
Final Boolean provisioned = mupdatemonitor. isdeviceprovisioned ();
...
If (! Lockedormissing &&! Provisioned ){
If (Debug) log. D (TAG, "dokeyguard: Not showing because device isn' t provisioned"
+ "And the SIM is not locked or missing ");
Return;
}
2. Frameworks/base/policies/phone/COM/Android/Internal/policy/impl/keyguardupdatemonitor. java.
Public Boolean isdeviceprovisioned (){
Return mdeviceprovisioned;
}
In public keyguardupdatemonitor (context) routine:
Mdeviceprovisioned = settings. Secure. getint (
Mcontext. getcontentresolver (), settings. Secure. device_provisioned, 0 )! = 0;
3. Frameworks/base/CORE/Java/Android/provider/settings. Java
Public static final string device_provisioned = secure. device_provisioned;
The default value for device_provisioned is 0, need set it to 1.
Fix 1: (modify the database)
$ ADB Shell
$ CD Data/data/COM. Android. providers. Settings/databases
$ Sqlite3 settings. DB
SQLite>. Tables
SQLite> select * from secure;
SQLite> insert into secure (name, value) values ('device _ provisioned', 1 );
SQLite>. Exit
$
Reboot the phone, lock screen shows up. Note that this modification also enables the home and some other key functions.
Fix 2: (need to rebuild the image)
1. Modify packages/apps/launcher/src/COM/Android/launcher. Java as follows:
1): Add "Import Android. provider. settings;" to the header.
2): Add below line to somewhere of the oncreate () routine:
Settings. Secure. putint (getcontentresolver (), settings. Secure. device_provisioned, 1 );
2. Add write permission in packages/apps/launcher/androidmenifest. xml:
<! -<Uses-Permission Android: Name = "android. Permission. write_settings"/> already exist->
<Uses-Permission Android: Name = "android. Permission. write_secure_settings"/>
Rebuild the image. The lock pattern and Home key function wocould work now.
Note: Since Android 2.2 (froyo), a default provision package has been added to the system image. So the issue has gone.