Merge "Update AppOpsService to remove user state after the user is removed."
This commit is contained in:
committed by
Android (Google) Code Review
commit
4b331cc154
@@ -2277,6 +2277,16 @@ public class AppOpsService extends IAppOpsService.Stub {
|
||||
ClientRestrictionState opRestrictions = mOpUserRestrictions.valueAt(i);
|
||||
opRestrictions.removeUser(userHandle);
|
||||
}
|
||||
removeUidsForUserLocked(userHandle);
|
||||
}
|
||||
}
|
||||
|
||||
private void removeUidsForUserLocked(int userHandle) {
|
||||
for (int i = mUidStates.size() - 1; i >= 0; --i) {
|
||||
final int uid = mUidStates.keyAt(i);
|
||||
if (UserHandle.getUserId(uid) == userHandle) {
|
||||
mUidStates.removeAt(i);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2396,6 +2406,12 @@ public class AppOpsService extends IAppOpsService.Stub {
|
||||
perUserExcludedPackages = null;
|
||||
}
|
||||
}
|
||||
if (perUserRestrictions != null) {
|
||||
perUserRestrictions.remove(userId);
|
||||
if (perUserRestrictions.size() <= 0) {
|
||||
perUserRestrictions = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public boolean isDefault() {
|
||||
|
||||
Reference in New Issue
Block a user