0

权限 oppo 的代码无法加载应用程序。Oppo 手机无法在后台处理通知,但是当我使用这些代码时,它运行良好:

val POWERMANAGER_INTENTS = arrayOf(
        Intent().setComponent(
            ComponentName(
                "com.coloros.safecenter",
                "com.coloros.safecenter.permission.startup.StartupAppListActivity"
            )
        ),
        Intent().setComponent(
            ComponentName(
                "com.coloros.safecenter",
                "com.coloros.safecenter.startupapp.StartupAppListActivity"
            )
        )
    )

但是这段代码导致我的应用程序无法加载。它会犯这样的错误:

java.lang.RuntimeException: Unable to start activity ComponentInfo{com.firebasesms.hong/com.firebasesms.hong.MainActivity}: java.lang.SecurityException: Permission Denial: starting Intent.......

Caused by: java.lang.SecurityException: Permission Denial: starting Intent ..... requires oppo.permission.OPPO_COMPONENT_SAFE

AndroidManifest

在此处输入图像描述

代码:科特林

在此处输入图像描述

错误:需要 oppo.permission.OPPO_COMPONENT_SAFE

在此处输入图像描述

4

1 回答 1

0

您需要在清单中获得“OPPO_COMPONENT_SAFE”权限才能启动 Intent。

    <!--for OPPO-->
<uses-permission android:name="oppo.permission.OPPO_COMPONENT_SAFE" />

参考:拒绝权限 OPPO_COMPONENT_SAFE

于 2019-05-28T06:42:26.220 回答