现在的位置: 首页 > 综合 > 正文

[转]使HOME键有效

2013年06月21日 ⁄ 综合 ⁄ 共 1328字 ⁄ 字号 评论关闭

转帖自:rootfs.wordpress.com

 

[Android] Enable HOME screen lock and HOME key

July 23, 2010 by rootfs

The lock patten does not take effect after setting. And the HOME key does not work.

1. frameworks/policies/base/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/policies/base/phone/com/android/internal/policy/impl/KeyguardUpdateMonitor.java.

public boolean isDeviceProvisioned() {
return mDeviceProvisioned;
}

In public KeyguardUpdateMonitor(Context 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: (Ubuntu host)

$ cd /opt/nfs/tiomap2430/android/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.

抱歉!评论已关闭.