Unsuspending packages on suspending app data clear
A suspending app loses all app data, jobs, alarms, etc. when its data is
cleared. The packages it suspended should get unsuspended so the device
is not left in an inconsistent state.
Also simplifying the permission check to block any cross user calls not
from system or root.
Test: Manual test by suspending with com.android.frameworks.servicestests
and then clearing data via Settings and also "adb shell pm clear"
Bug: 77801553
Change-Id: I20424322b5917f3b87e2cf48a6444de9f242d311
diff --git a/services/core/java/com/android/server/pm/permission/PermissionManagerService.java b/services/core/java/com/android/server/pm/permission/PermissionManagerService.java
index f659225..d3526f7 100644
--- a/services/core/java/com/android/server/pm/permission/PermissionManagerService.java
+++ b/services/core/java/com/android/server/pm/permission/PermissionManagerService.java
@@ -1953,7 +1953,7 @@
UserManager.DISALLOW_DEBUGGING_FEATURES, callingUid, userId);
}
if (userId == UserHandle.getUserId(callingUid)) return;
- if (callingUid != Process.SYSTEM_UID && callingUid != 0) {
+ if (callingUid != Process.SYSTEM_UID && callingUid != Process.ROOT_UID) {
if (requireFullPermission) {
mContext.enforceCallingOrSelfPermission(
android.Manifest.permission.INTERACT_ACROSS_USERS_FULL, message);