Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b4bd680f authored by Songchun Fan's avatar Songchun Fan
Browse files

[am/incremental] force stop unstartable apps

As discussed offline, ActivityManagerService listens to the
PACKAGE_UNSTARTABLE broadcast and force stop the app based on the
package name contained in the broadcast intent.

BUG: 170161310
Test: manual
Change-Id: Idc02e8b3c7adf6d20615b1740bdbb1f88179bf5d
parent a3e52bf4
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -13663,6 +13663,11 @@ public class ActivityManagerService extends IActivityManager.Stub
                case Intent.ACTION_PRE_BOOT_COMPLETED:
                    timeoutExempt = true;
                    break;
                case Intent.ACTION_PACKAGE_UNSTARTABLE:
                    final String packageName = intent.getStringExtra(Intent.EXTRA_PACKAGE_NAME);
                    forceStopPackageLocked(packageName, -1, false, true, true,
                            false, false, userId, "package unstartable");
                    break;
            }
            if (Intent.ACTION_PACKAGE_ADDED.equals(action) ||