5

Previously, an intent with one of the following components lead me to Huawei's system settings to change the auto-start behavior of an app.

    ComponentName(
            "com.huawei.systemmanager",
            "com.huawei.systemmanager.startupmgr.ui.StartupNormalAppListActivity"
        ),
        ComponentName(
            "com.huawei.systemmanager",
            "com.huawei.systemmanager.appcontrol.activity.StartupAppControlActivity"
        )

Stacktrace:

java.lang.SecurityException: Permission Denial: starting Intent { flg=0x10000000 cmp=com.huawei.systemmanager/.startupmgr.ui.StartupNormalAppListActivity } from ProcessRecord{34a529e 19272:com.mk...test/u0a733} (pid=19272, uid=10733) requires com.huawei.permission.external_app_settings.USE_COMPONENT
    at android.os.Parcel.createException(Parcel.java:2071)
    at android.os.Parcel.readException(Parcel.java:2039)
    at android.os.Parcel.readException(Parcel.java:1987)
    at android.app.IActivityTaskManager$Stub$Proxy.startActivity(IActivityTaskManager.java:3888)
    at android.app.Instrumentation.execStartActivity(Instrumentation.java:1738)
    at androidx.test.runner.MonitoringInstrumentation.execStartActivity(MonitoringInstrumentation.java:545)
    at android.app.ContextImpl.startActivity(ContextImpl.java:1049)
    at android.app.ContextImpl.startActivity(ContextImpl.java:1005)
    at java.lang.reflect.Method.invoke(Native Method)
    at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
    at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
    at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
    at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
    at androidx.test.internal.runner.junit4.statement.RunBefores.evaluate(RunBefores.java:80)
    at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
    at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
    at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
    at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
    at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
    at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
    at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
    at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
    at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
    at org.junit.runners.Suite.runChild(Suite.java:128)
    at org.junit.runners.Suite.runChild(Suite.java:27)
    at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
    at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
    at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
    at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
    at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
    at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
    at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
    at org.junit.runner.JUnitCore.run(JUnitCore.java:115)
    at androidx.test.internal.runner.TestExecutor.execute(TestExecutor.java:56)
    at androidx.test.runner.AndroidJUnitRunner.onStart(AndroidJUnitRunner.java:395)
    at android.app.Instrumentation$InstrumentationThread.run(Instrumentation.java:2258)
Caused by: android.os.RemoteException: Remote stack trace:
    at com.android.server.wm.ActivityStackSupervisor.checkStartAnyActivityPermission(ActivityStackSupervisor.java:1194)
    at com.android.server.wm.ActivityStarter.startActivity(ActivityStarter.java:904)
    at com.android.server.wm.ActivityStarter.startActivity(ActivityStarter.java:652)
    at com.android.server.wm.HwActivityStarter.startActivity(HwActivityStarter.java:292)
    at com.android.server.wm.ActivityStarter.startActivityMayWait(ActivityStarter.java:1647)

The permission that is mentioned in the Stracktrace is declared in my Manifest file.

 <uses-permission android:name="com.huawei.permission.external_app_settings.USE_COMPONENT"/>

This definitely worked before, and I seem to remember there was a security update for my Huawei P30 Pro.

What is now the correct procedure? Why is it complaining about the missing permission, though it is declared?

1 Answers1

3

the intent for "App Launch" settings is not supported anymore on all EMUI since beginning of 2021 due to security reasons.

Minki
  • 934
  • 5
  • 14