0

Code for permission oppo cannot load app. Oppo phone cannot handle notification in background, but when I use these code it work well:

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"
            )
        )
    )

But this code cause my app cannnot load. it's make error like that:

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

enter image description here

Code: Kotlin

enter image description here

Error: requires oppo.permission.OPPO_COMPONENT_SAFE

enter image description here

booc booc
  • 33
  • 5

1 Answers1

0

You need "OPPO_COMPONENT_SAFE" permission into your manifest to start Intent.

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

Reference: Denial permission OPPO_COMPONENT_SAFE