commit | efbde595512aa2594a70086638118967be301849 | [log] [tgz] |
---|---|---|
author | Sudheer Shanka <sudheersai@google.com> | Thu Apr 04 11:33:43 2024 -0700 |
committer | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | Tue May 21 14:07:02 2024 +0000 |
tree | 3272fd1160ed5a413bf4818c917ca4064edf6d27 | |
parent | e92c24d1e0488fd2703e93f147034cc1dd1f366a [diff] |
Don't cancel PendingIntents unless the stay_stopped flag is on. This change should be accompanied by other enhancements needed to harden the stopped state. So, only cancel PendingIntents for stopped apps when the flag is enabled. Bug: 332922400 Test: atest tests/app/src/android/app/cts/ForceStopTest.java (cherry picked from https://googleplex-android-review.googlesource.com/q/commit:63d699245f19338d63f320d2b80b4a3bcbd7ae21) Merged-In: I186f43ca0736072ab8f235e448deff304dda84cb Change-Id: I186f43ca0736072ab8f235e448deff304dda84cb
diff --git a/services/core/java/com/android/server/am/ActivityManagerService.java b/services/core/java/com/android/server/am/ActivityManagerService.java index 663ba8a..7f5a865 100644 --- a/services/core/java/com/android/server/am/ActivityManagerService.java +++ b/services/core/java/com/android/server/am/ActivityManagerService.java
@@ -4451,7 +4451,9 @@ } } - if (packageName == null || uninstalling || packageStateStopped) { + final boolean clearPendingIntentsForStoppedApp = (android.content.pm.Flags.stayStopped() + && packageStateStopped); + if (packageName == null || uninstalling || clearPendingIntentsForStoppedApp) { didSomething |= mPendingIntentController.removePendingIntentsForPackage( packageName, userId, appId, doit); }