Loading core/java/android/permission/flags.aconfig +11 −0 Original line number Diff line number Diff line Loading @@ -223,3 +223,14 @@ flag { description: "Show access entry of location bypass permission in the Privacy Dashboard" bug: "325536053" } flag { name: "dont_remove_existing_uid_states" is_fixed_read_only: true namespace: "permissions" description: "Double check if the uid still exists before attempting to remove its appops state" bug: "353474742" metadata { purpose: PURPOSE_BUGFIX } } services/core/java/com/android/server/appop/AppOpsService.java +16 −0 Original line number Diff line number Diff line Loading @@ -1413,6 +1413,22 @@ public class AppOpsService extends IAppOpsService.Stub { } public void uidRemoved(int uid) { if (Flags.dontRemoveExistingUidStates()) { // b/358365471 If apps sharing UID are installed on multiple users and only one of // them is installed for a single user while keeping the others we observe this // subroutine get invoked incorrectly since the UID still exists. final long token = Binder.clearCallingIdentity(); try { String uidName = getPackageManagerInternal().getNameForUid(uid); if (uidName != null) { Slog.e(TAG, "Tried to remove existing UID. uid: " + uid + " name: " + uidName); return; } } finally { Binder.restoreCallingIdentity(token); } } synchronized (this) { if (mUidStates.indexOfKey(uid) >= 0) { mUidStates.get(uid).clear(); Loading Loading
core/java/android/permission/flags.aconfig +11 −0 Original line number Diff line number Diff line Loading @@ -223,3 +223,14 @@ flag { description: "Show access entry of location bypass permission in the Privacy Dashboard" bug: "325536053" } flag { name: "dont_remove_existing_uid_states" is_fixed_read_only: true namespace: "permissions" description: "Double check if the uid still exists before attempting to remove its appops state" bug: "353474742" metadata { purpose: PURPOSE_BUGFIX } }
services/core/java/com/android/server/appop/AppOpsService.java +16 −0 Original line number Diff line number Diff line Loading @@ -1413,6 +1413,22 @@ public class AppOpsService extends IAppOpsService.Stub { } public void uidRemoved(int uid) { if (Flags.dontRemoveExistingUidStates()) { // b/358365471 If apps sharing UID are installed on multiple users and only one of // them is installed for a single user while keeping the others we observe this // subroutine get invoked incorrectly since the UID still exists. final long token = Binder.clearCallingIdentity(); try { String uidName = getPackageManagerInternal().getNameForUid(uid); if (uidName != null) { Slog.e(TAG, "Tried to remove existing UID. uid: " + uid + " name: " + uidName); return; } } finally { Binder.restoreCallingIdentity(token); } } synchronized (this) { if (mUidStates.indexOfKey(uid) >= 0) { mUidStates.get(uid).clear(); Loading