之前,包含以下组件之一的Intent将我引导到华为的系统设置,以更改应用程序的自动启动行为。
ComponentName(
"com.huawei.systemmanager",
"com.huawei.systemmanager.startupmgr.ui.StartupNormalAppListActivity"
),
ComponentName(
"com.huawei.systemmanager",
"com.huawei.systemmanager.appcontrol.activity.StartupAppControlActivity"
)
堆栈跟踪:
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)
Stracktrace中提到的权限在我的Manifest文件中声明。
<uses-permission android:name="com.huawei.permission.external_app_settings.USE_COMPONENT"/>
这在以前绝对有效,我似乎记得我的华为P30 Pro有一个安全更新。
现在正确的程序是什么?为什么它会抱怨缺少的权限,尽管它已经声明了?
1条答案
按热度按时间vi4fp9gy1#
由于安全原因,自2021年初起,所有EMUI不再支持“应用启动”设置的意图。