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

更多相关文章

  1. 代码中设置drawableleft
  2. android 3.0 隐藏 系统标题栏
  3. Android开发中activity切换动画的实现
  4. Android(安卓)学习 笔记_05. 文件下载
  5. Android中直播视频技术探究之—摄像头Camera视频源数据采集解析
  6. 技术博客汇总
  7. android 2.3 wifi (一)
  8. AndRoid Notification的清空和修改
  9. Android中的Chronometer

随机推荐

  1. Android中ButterKnife框架
  2. Android 中多点触摸协议
  3. 转:Android(安卓)内存泄漏调试
  4. Android之service探究
  5. Android基于LLVM的Native层代码混淆
  6. android用户界面之TabHost教程实例汇总
  7. android 之 布局属性--RelativeLayout
  8. 2011.09.01(3)——— android service star
  9. Intent常用Uri,打开相应的应用
  10. Android应用程序创建桌面快捷方式