A number of OEMs, when a settings intent is launched the device is not prepared to handle, will crash out the process. This looks like MANAGED SETTINGS falling over, but is in fact com.android.settings crashing and returning to MS in an unexpected way.
Two examples of this might be:
Mobile settings (or APN, roaming) when no SIM or CDMA profile is assigned
Bluetooth on older Android versions
To Reproduce
Steps to reproduce the behavior:
Remove SIM/eSIM from device
Try to open into Mobile settings from MS
Witness a crash
Expected behavior
MS should detect when a device with telephony hasn't got a mobile profile/SIM installed and prevent interaction, and equivalent behaviour for other intents with dependencies such as these.
MS should prevent interaction when the declared feature is not present (ie, no NFC, no Bluetooth, etc).
Fatal exception
java.lang.SecurityException: Permission Denial: starting Intent { act=android.settings.APN_SETTINGS cmp=com.android.phone/com.android.simsettings.apn.ApnSettings mCallingUid=10294 } from ProcessRecord{50f5993 28185:org.bayton.managedsettings/u0a294} (pid=28185, uid=10294) not exported from uid 1001
FATAL EXCEPTION: Thread-2
Process: org.bayton.managedsettings, PID: 28185
java.lang.SecurityException: Permission Denial: starting Intent { act=android.settings.APN_SETTINGS cmp=com.android.phone/com.android.simsettings.apn.ApnSettings mCallingUid=10294 } from ProcessRecord{50f5993 28185:org.bayton.managedsettings/u0a294} (pid=28185, uid=10294) not exported from uid 1001
at android.os.Parcel.createExceptionOrNull(Parcel.java:3040)
at android.os.Parcel.createException(Parcel.java:3024)
at android.os.Parcel.readException(Parcel.java:3007)
at android.os.Parcel.readException(Parcel.java:2949)
at android.app.IActivityTaskManager$Stub$Proxy.startActivity(IActivityTaskManager.java:2043)
at android.app.Instrumentation.execStartActivity(Instrumentation.java:1827)
at android.app.Activity.startActivityForResult(Activity.java:5580)
at androidx.activity.ComponentActivity.startActivityForResult(ComponentActivity.java:780)
at android.app.Activity.startActivityForResult(Activity.java:5533)
at androidx.activity.ComponentActivity.startActivityForResult(ComponentActivity.java:761)
at android.app.Activity.startActivity(Activity.java:6036)
at androidx.core.content.ContextCompat.startActivity(ContextCompat.java:295)
at androidx.fragment.app.FragmentHostCallback.onStartActivityFromFragment(FragmentHostCallback.java:166)
at androidx.fragment.app.Fragment.startActivity(Fragment.java:1448)
at androidx.fragment.app.Fragment.startActivity(Fragment.java:1436)
at org.bayton.managedsettings.ui.SettingsFragment.openApnSettings(SettingsFragment.kt:258)
at org.bayton.managedsettings.ui.SettingsFragment.onViewCreated$lambda$4(SettingsFragment.kt:62)
at org.bayton.managedsettings.ui.SettingsFragment.$r8$lambda$c96PUtyVAf86QuveXwHR5hblGok(Unknown Source:0)
at org.bayton.managedsettings.ui.SettingsFragment$$ExternalSyntheticLambda5.onClick(D8$$SyntheticClass:0)
at android.view.View.performClick(View.java:7570)
at android.view.View.performClickInternal(View.java:7540)
at android.view.View.-$$Nest$mperformClickInternal(Unknown Source:0)
at android.view.View$PerformClick.run(View.java:29710)
at android.os.Handler.handleCallback(Handler.java:942)
at android.os.Handler.dispatchMessage(Handler.java:99)
at androidx.test.espresso.base.Interrogator.loopAndInterrogate(Interrogator.java:10)
at androidx.test.espresso.base.UiControllerImpl.loopUntil(UiControllerImpl.java:7)
at androidx.test.espresso.base.UiControllerImpl.loopUntil(UiControllerImpl.java:1)
at androidx.test.espresso.base.UiControllerImpl.injectMotionEvent(UiControllerImpl.java:5)
at androidx.test.espresso.action.MotionEvents.sendUp(MotionEvents.java:6)
at androidx.test.espresso.action.MotionEvents.sendUp(MotionEvents.java:1)
at androidx.test.espresso.action.Tap.sendSingleTap(Tap.java:5)
at androidx.test.espresso.action.Tap.-$$Nest$smsendSingleTap(Unknown Source:0)
at androidx.test.espresso.action.Tap$1.sendTap(Tap.java:1)
at androidx.test.espresso.action.GeneralClickAction.perform(GeneralClickAction.java:4)
at androidx.test.espresso.ViewInteraction$SingleExecutionViewAction.perform(ViewInteraction.java:2)
at androidx.test.espresso.ViewInteraction.doPerform(ViewInteraction.java:23)
at androidx.test.espresso.ViewInteraction.-$$Nest$mdoPerform(Unknown Source:0)
at androidx.test.espresso.ViewInteraction$1.call(ViewInteraction.java:6)
at androidx.test.espresso.ViewInteraction$1.call(ViewInteraction.java:1)
at java.util.concurrent.FutureTask.run(FutureTask.java:264)
at android.os.Handler.handleCallback(Handler.java:942)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loopOnce(Looper.java:240)
at android.os.Looper.loop(Looper.java:351)
at android.app.ActivityThread.main(ActivityThread.java:8427)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:584)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1013)
Caused by: android.os.RemoteException: Remote stack trace:
at com.android.server.wm.ActivityTaskSupervisor.checkStartAnyActivityPermission(ActivityTaskSupervisor.java:1212)
at com.android.server.wm.ActivityStarter.executeRequest(ActivityStarter.java:1126)
at com.android.server.wm.ActivityStarter.execute(ActivityStarter.java:771)
at com.android.server.wm.ActivityTaskManagerService.startActivityAsUser(ActivityTaskManagerService.java:1320)
at com.android.server.wm.ActivityTaskManagerService.startActivityAsUser(ActivityTaskManagerService.java:1283)
Describe the bug
A number of OEMs, when a settings intent is launched the device is not prepared to handle, will crash out the process. This looks like MANAGED SETTINGS falling over, but is in fact com.android.settings crashing and returning to MS in an unexpected way.
Two examples of this might be:
To Reproduce Steps to reproduce the behavior:
Expected behavior
feature
is not present (ie, no NFC, no Bluetooth, etc).Screenshots or video Last 10s of this test video:
https://github.com/user-attachments/assets/3ee90a38-b99c-4263-8f84-f601689beafb
Logs