加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

[转]使HOME键有效

发布时间:2020-12-12 23:31:55 所属栏目:百科 来源:网络整理
导读:转帖自: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/po

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

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读