锁屏设置:
1. 初始值 : <integer name="def_screen_off_timeout">60000</integer>
2. 数据库/data/data/com.android.providers.settings/databases/settings.db中
system 表 screen_off_timeout.
3. 开机锁屏, 在frameworks/policies/base/phone/com/android/internal/policy/impl/KeyguardViewMediator.java 文件中修改 mExternallyEnabled 值为false即可. 或者调用setKeyguardEnabled来解锁.
4. 程序禁止锁屏:
方法一:
getWindow().setFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON, WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
方法二:
mWakeLock = pManager.newWakeLock(PowerManager.SCREEN_BRIGHT_WAKE_LOCK
| PowerManager.ON_AFTER_RELEASE, TAG);
mWakeLock.acquire();
参考:
android禁止锁频 http://my.unix-center.net/~Simon_fu/?p=538
锁屏方法和android事件处理过程分析 http://blog.sina.com.cn/s/blog_3e3fcadd0100hrzf.html
Android下Dialog及Activity屏蔽Home键详解