MIUI权限被拒绝的活动KeyguardLocked [英] MIUI Permission Denied Activity KeyguardLocked

查看:252
本文介绍了MIUI权限被拒绝的活动KeyguardLocked的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当应用程序在后台并且屏幕被锁定时,我无法启动活动,没有异常或警告,仅未调用onCreate().我一直在努力解决这个问题,而且我想我终于找到了它的根源. 日志中有一行:

When application is in background and screen is locked,I'm unable to start activity, there is no exception or warning, onCreate() is just not called. I've been struggling against this problem for while, and I think I've finally found the source of it. There is a line in logs:

D/com.android.server.am.ExtraActivityManagerService: MIUILOG- Permission Denied Activity KeyguardLocked: Intent { flg=0x14010000 cmp=com.trueconf.videochat/com.trueconf.gui.activities.Call (has extras) } pkg : com.trueconf.videochat uid : 10634

这就是为什么我无法开始活动吗?另外,如何解决此问题,应该禁用键盘锁或其他工具吗?

Is this why I can't start an activity? Also, how do I solve this, should I disable keyguard or something?

推荐答案

这是必须为应用启用的MIUI特殊权限.

This is a special permission on MIUI that has to be enabled for apps.

您可以在以下位置找到它

You can find it in

  1. 设置
  2. 管理应用
  3. 您的APP
  4. 其他权限
  5. 在锁定屏幕上显示

用户必须手动启用此功能.据我所知,您最好的办法就是通过启动一个意图(并可能在此之前显示一些解释器文本)直接将用户引导至此设置菜单.

User must enable this manually. As far as I know, the best you can do is to guide the user to this settings menu directly by launching an intent (and probably showing some explainer text prior to this).

意图看起来像这样

startActivity(new Intent("miui.intent.action.APP_PERM_EDITOR").putExtra("extra_pkgname", getPackageName()))

请确保尝试捕获它,因为如果无法启动活动(例如,该设备实际上未运行MIUI或该意图在特定设备/版本上无效),它可能会引发异常

Make sure to try catch it as it can throw exceptions if activity can't be started (e.g. the device actually is not running MIUI or the intent is somehow not valid on the particular device/version)

这篇关于MIUI权限被拒绝的活动KeyguardLocked的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆