Merge "Check if caller is suspending package before unsuspended broadcast" into tm-qpr-dev

This commit is contained in:
TreeHugger Robot
2022-09-13 23:18:41 +00:00
committed by Android (Google) Code Review

View File

@@ -160,9 +160,11 @@ public final class SuspendPackageHelper {
}
}
// If size one, the package will be unsuspended from this call
boolean packageUnsuspended =
!suspended && CollectionUtils.size(suspendParamsMap) <= 1;
// If only the callingPackage is suspending this package,
// it will be unsuspended when this change is committed
boolean packageUnsuspended = !suspended
&& CollectionUtils.size(suspendParamsMap) == 1
&& suspendParamsMap.containsKey(callingPackage);
if (suspended || packageUnsuspended) {
changedPackagesList.add(packageName);
changedUids.add(UserHandle.getUid(userId, packageState.getAppId()));