Description
When committing a session-based install, the system provides an EXTRA_INTENT via STATUS_PENDING_USER_ACTION (for instance, with action android.content.pm.action.CONFIRM_INSTALL targeting com.google.android.packageinstaller).
In SessionBasedInstallConfirmationActivity (around launchInstallActivity / onCreate), Ackpine calls startActivityForResult(intent).
On devices where the targeted package installer (e.g. com.google.android.packageinstaller) is disabled, frozen, or removed (e.g., custom AOSP/LineageOS ROMs, debloated OEM devices, or custom OEM package installer configurations), startActivityForResult throws an unhandled ActivityNotFoundException, which causes the host application process to fatally crash.
Expected Behavior
SessionBasedInstallConfirmationActivity should safely catch ActivityNotFoundException (or handle intent resolution failures) and fail/abort the session gracefully with an appropriate error/state instead of crashing the host process.
Environment
- Ackpine version:
0.25.4 (and earlier versions)
- Android OS versions: Android 13/14/15
Stacktrace
Fatal Exception: java.lang.RuntimeException: Unable to start activity ComponentInfo{<package>/ru.solrudev.ackpine.impl.installer.activity.SessionBasedInstallConfirmationActivity}: android.content.ActivityNotFoundException: No Activity found to handle Intent { act=android.content.pm.action.CONFIRM_INSTALL pkg=com.google.android.packageinstaller (has extras) }
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3823)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3963)
at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:103)
at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:139)
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:96)
at android.app.ActivityThread.handleMessage(ActivityThread.java:2484)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loopOnce(Looper.java:205)
at android.os.Looper.loop(Looper.java:294)
at android.app.ActivityThread.main(ActivityThread.java:8227)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.RuntimeInit.run(RuntimeInit.java:573)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1049)
Caused by android.content.ActivityNotFoundException: No Activity found to handle Intent { act=android.content.pm.action.CONFIRM_INSTALL pkg=com.google.android.packageinstaller (has extras) }
at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:2239)
at android.app.Instrumentation.execStartActivity(Instrumentation.java:1878)
at android.app.Activity.startActivityForResult(Activity.java:5589)
at android.app.Activity.startActivityForResult(Activity.java:5547)
at ru.solrudev.ackpine.impl.activity.SessionCommitActivity.startActivityForResult(SessionCommitActivity.java:150)
at ru.solrudev.ackpine.impl.installer.activity.SessionBasedInstallConfirmationActivity.launchInstallActivity(SessionBasedInstallConfirmationActivity.kt:269)
at ru.solrudev.ackpine.impl.installer.activity.SessionBasedInstallConfirmationActivity.onCreate(SessionBasedInstallConfirmationActivity.kt:99)
Description
When committing a session-based install, the system provides an
EXTRA_INTENTviaSTATUS_PENDING_USER_ACTION(for instance, with actionandroid.content.pm.action.CONFIRM_INSTALLtargetingcom.google.android.packageinstaller).In
SessionBasedInstallConfirmationActivity(aroundlaunchInstallActivity/onCreate), Ackpine callsstartActivityForResult(intent).On devices where the targeted package installer (e.g.
com.google.android.packageinstaller) is disabled, frozen, or removed (e.g., custom AOSP/LineageOS ROMs, debloated OEM devices, or custom OEM package installer configurations),startActivityForResultthrows an unhandledActivityNotFoundException, which causes the host application process to fatally crash.Expected Behavior
SessionBasedInstallConfirmationActivityshould safely catchActivityNotFoundException(or handle intent resolution failures) and fail/abort the session gracefully with an appropriate error/state instead of crashing the host process.Environment
0.25.4(and earlier versions)Stacktrace