禁用键盘防护并在系统启动时显示活动

发布于 2024-12-03 12:02:14 字数 362 浏览 5 评论 0原文

考虑一下:

KeyguardManager keyguardManager = (KeyguardManager)getSystemService(Activity.KEYGUARD_SERVICE);
KeyguardLock lock = keyguardManager.newKeyguardLock(KEYGUARD_SERVICE);
lock.disableKeyguard();

我已经完成了上面的代码来禁用锁屏活动的键盘保护,并且当屏幕关闭时正常触发或短信服务触发它时它会起作用。

我已将其设置为在 Android 系统启动时启动。但是,出现了键盘锁,我必须先将其解锁,然后才能看到自己的锁屏。我该如何解决这个问题?

Consider:

KeyguardManager keyguardManager = (KeyguardManager)getSystemService(Activity.KEYGUARD_SERVICE);
KeyguardLock lock = keyguardManager.newKeyguardLock(KEYGUARD_SERVICE);
lock.disableKeyguard();

I have done the above code to disable the keyguard of my lockscreen activity and it works when normal trigger or SMS service triggers it when the screen is off.

I have set it to be started onboot of the Android. However, the keyguard appears and I have to unlock it before I see my own lockscreen. How can I solve this?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(1

彡翼 2024-12-10 12:02:14

这是有道理的,因为启动时还有一些其他进程先于所有其他应用程序运行。

但是,如果您希望将其作为第一个,请将其设置为应用程序启动器。

当然,您可能想将主页按钮意图传递给前一个启动器,当然,在预期的情况下......

It makes sense, since there are some other processes to run on boot before all other applications.

However, if you wish to have it as one of the first, set it as an app launcher.

You might want to pass home-button intents to the previous launcher, of course, when it's expected...

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