Android 手机开机自动解锁

发布于 2024-11-07 15:27:17 字数 364 浏览 3 评论 0原文

我捕捉到了手机启动事件。 在启动完成事件中,我正在编写以下代码

        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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

花心好男孩 2024-11-14 15:27:17

但是我能看到锁定并且屏幕解锁后发生了什么

您没有锁定屏幕。因此,您无法解锁它。 disableKeyguard() 仅用于逆转 reenableKeyguard() 的效果。

我的猜测是我需要在设置文件中的某个地方对框架进行修改。

如果“设置文件”是指“Java,或者可能是 C/C++,源代码”,那么是的,情况可能就是这样。

但我不知道该修改哪里。

抱歉,StackOverflow 不是帮助固件修改的好资源。

but what happing I can able to see lock and after that screen is getting unlocked

You did not lock the screen. Hence, you cannot unlock it. disableKeyguard() is only used to reverse the effects of reenableKeyguard().

My guess is that I need to make modification in framework somewhere in setting file.

If by "setting file" you mean "Java, or possibly C/C++, source code", then yes that is probably the case.

But I don't know where to modify.

StackOverflow is not a great resource for assistance with firmware modifications, sorry.

为人所爱 2024-11-14 15:27:17

我通过在 KeyguardViewMediator 中注释以下代码来做到这一点

private void showLocked() {

   /* if (DEBUG) Log.d(TAG, "showLocked");

    Message msg = mHandler.obtainMessage(SHOW);

    mHandler.sendMessage(msg);*/

}

I have did it by commenting following code in KeyguardViewMediator

private void showLocked() {

   /* if (DEBUG) Log.d(TAG, "showLocked");

    Message msg = mHandler.obtainMessage(SHOW);

    mHandler.sendMessage(msg);*/

}

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文