Loading services/core/java/com/android/server/am/ActiveServices.java +13 −1 Original line number Diff line number Diff line Loading @@ -5183,7 +5183,7 @@ public final class ActiveServices { } boolean bringDownDisabledPackageServicesLocked(String packageName, Set<String> filterByClasses, int userId, boolean evenPersistent, boolean doit) { int userId, boolean evenPersistent, boolean fullStop, boolean doit) { boolean didSomething = false; if (mTmpCollectionResults != null) { Loading Loading @@ -5221,6 +5221,18 @@ public final class ActiveServices { if (size > 0) { mAm.updateOomAdjPendingTargetsLocked(OomAdjuster.OOM_ADJ_REASON_UNBIND_SERVICE); } if (fullStop && !mTmpCollectionResults.isEmpty()) { // if we're tearing down the app's entire service state, account for possible // races around FGS notifications by explicitly tidying up in a separate // pass post-shutdown final ArrayList<ServiceRecord> allServices = (ArrayList<ServiceRecord>) mTmpCollectionResults.clone(); mAm.mHandler.postDelayed(() -> { for (int i = 0; i < allServices.size(); i++) { allServices.get(i).cancelNotification(); } }, 250L); } mTmpCollectionResults.clear(); } Loading services/core/java/com/android/server/am/ActivityManagerService.java +4 −3 Original line number Diff line number Diff line Loading @@ -4361,7 +4361,8 @@ public class ActivityManagerService extends IActivityManager.Stub // Clean-up disabled services. mServices.bringDownDisabledPackageServicesLocked( packageName, disabledClasses, userId, false /* evenPersistent */, true /* doIt */); packageName, disabledClasses, userId, false /* evenPersistent */, false /* fullStop */, true /* doIt */); // Clean-up disabled providers. ArrayList<ContentProviderRecord> providers = new ArrayList<>(); Loading Loading @@ -4436,7 +4437,7 @@ public class ActivityManagerService extends IActivityManager.Stub } mServices.bringDownDisabledPackageServicesLocked( packageName, null, userId, false, true); packageName, null, userId, false, true, true); if (mBooted) { mAtmInternal.resumeTopActivities(true); Loading Loading @@ -4489,7 +4490,7 @@ public class ActivityManagerService extends IActivityManager.Stub } if (mServices.bringDownDisabledPackageServicesLocked( packageName, null /* filterByClasses */, userId, evenPersistent, doit)) { packageName, null /* filterByClasses */, userId, evenPersistent, true, doit)) { if (!doit) { return true; } Loading Loading
services/core/java/com/android/server/am/ActiveServices.java +13 −1 Original line number Diff line number Diff line Loading @@ -5183,7 +5183,7 @@ public final class ActiveServices { } boolean bringDownDisabledPackageServicesLocked(String packageName, Set<String> filterByClasses, int userId, boolean evenPersistent, boolean doit) { int userId, boolean evenPersistent, boolean fullStop, boolean doit) { boolean didSomething = false; if (mTmpCollectionResults != null) { Loading Loading @@ -5221,6 +5221,18 @@ public final class ActiveServices { if (size > 0) { mAm.updateOomAdjPendingTargetsLocked(OomAdjuster.OOM_ADJ_REASON_UNBIND_SERVICE); } if (fullStop && !mTmpCollectionResults.isEmpty()) { // if we're tearing down the app's entire service state, account for possible // races around FGS notifications by explicitly tidying up in a separate // pass post-shutdown final ArrayList<ServiceRecord> allServices = (ArrayList<ServiceRecord>) mTmpCollectionResults.clone(); mAm.mHandler.postDelayed(() -> { for (int i = 0; i < allServices.size(); i++) { allServices.get(i).cancelNotification(); } }, 250L); } mTmpCollectionResults.clear(); } Loading
services/core/java/com/android/server/am/ActivityManagerService.java +4 −3 Original line number Diff line number Diff line Loading @@ -4361,7 +4361,8 @@ public class ActivityManagerService extends IActivityManager.Stub // Clean-up disabled services. mServices.bringDownDisabledPackageServicesLocked( packageName, disabledClasses, userId, false /* evenPersistent */, true /* doIt */); packageName, disabledClasses, userId, false /* evenPersistent */, false /* fullStop */, true /* doIt */); // Clean-up disabled providers. ArrayList<ContentProviderRecord> providers = new ArrayList<>(); Loading Loading @@ -4436,7 +4437,7 @@ public class ActivityManagerService extends IActivityManager.Stub } mServices.bringDownDisabledPackageServicesLocked( packageName, null, userId, false, true); packageName, null, userId, false, true, true); if (mBooted) { mAtmInternal.resumeTopActivities(true); Loading Loading @@ -4489,7 +4490,7 @@ public class ActivityManagerService extends IActivityManager.Stub } if (mServices.bringDownDisabledPackageServicesLocked( packageName, null /* filterByClasses */, userId, evenPersistent, doit)) { packageName, null /* filterByClasses */, userId, evenPersistent, true, doit)) { if (!doit) { return true; } Loading