[转]使HOME键有效

前端之家收集整理的这篇文章主要介绍了[转]使HOME键有效前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

转帖自: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.

原文链接:https://www.f2er.com/sqlite/202815.html

猜你在找的Sqlite相关文章