Android 手机开机自动解锁
我捕捉到了手机启动事件。 在启动完成事件中,我正在编写以下代码
KeyguardManager mKeyguardManager = (KeyguardManager) mContext.getSystemService(KEYGUARD_SERVICE);
KeyguardLock mLock = mKeyguardManager.newKeyguardLock("MyApp");
mLock.disableKeyguard();
,但是很高兴我能够看到锁定,并且在该屏幕解锁之后。但要求是启动后锁不应该是可见的。 我的猜测是我需要在设置文件中的某个地方对框架进行修改。 但不知道该修改哪里。
I had caught phone boot event.
On boot complete event I am writing following code
KeyguardManager mKeyguardManager = (KeyguardManager) mContext.getSystemService(KEYGUARD_SERVICE);
KeyguardLock mLock = mKeyguardManager.newKeyguardLock("MyApp");
mLock.disableKeyguard();
but what happing I can able to see lock and after that screen is getting unlocked. But requirement is that lock should not be visible at all after booting.
My guess is that I need to make modification in framework somewhere in setting file.
But I don't know where to modify.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您没有锁定屏幕。因此,您无法解锁它。
disableKeyguard()
仅用于逆转reenableKeyguard()
的效果。如果“设置文件”是指“Java,或者可能是 C/C++,源代码”,那么是的,情况可能就是这样。
抱歉,StackOverflow 不是帮助固件修改的好资源。
You did not lock the screen. Hence, you cannot unlock it.
disableKeyguard()
is only used to reverse the effects ofreenableKeyguard()
.If by "setting file" you mean "Java, or possibly C/C++, source code", then yes that is probably the case.
StackOverflow is not a great resource for assistance with firmware modifications, sorry.
我通过在
KeyguardViewMediator
中注释以下代码来做到这一点}
I have did it by commenting following code in
KeyguardViewMediator
}