Merge "Cleans up userId loop in clearPackageStateForUser" into qt-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
662eb71dd0
@@ -10213,7 +10213,7 @@ public class PackageManagerService extends IPackageManager.Stub
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void destroyAppProfilesLIF(PackageParser.Package pkg, int userId) {
|
private void destroyAppProfilesLIF(PackageParser.Package pkg) {
|
||||||
if (pkg == null) {
|
if (pkg == null) {
|
||||||
Slog.wtf(TAG, "Package was null!", new Throwable());
|
Slog.wtf(TAG, "Package was null!", new Throwable());
|
||||||
return;
|
return;
|
||||||
@@ -18590,7 +18590,7 @@ public class PackageManagerService extends IPackageManager.Stub
|
|||||||
}
|
}
|
||||||
destroyAppDataLIF(resolvedPkg, UserHandle.USER_ALL,
|
destroyAppDataLIF(resolvedPkg, UserHandle.USER_ALL,
|
||||||
StorageManager.FLAG_STORAGE_DE | StorageManager.FLAG_STORAGE_CE);
|
StorageManager.FLAG_STORAGE_DE | StorageManager.FLAG_STORAGE_CE);
|
||||||
destroyAppProfilesLIF(resolvedPkg, UserHandle.USER_ALL);
|
destroyAppProfilesLIF(resolvedPkg);
|
||||||
if (outInfo != null) {
|
if (outInfo != null) {
|
||||||
outInfo.dataRemoved = true;
|
outInfo.dataRemoved = true;
|
||||||
}
|
}
|
||||||
@@ -19317,6 +19317,8 @@ public class PackageManagerService extends IPackageManager.Stub
|
|||||||
pkg = mPackages.get(ps.name);
|
pkg = mPackages.get(ps.name);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
destroyAppProfilesLIF(pkg);
|
||||||
|
|
||||||
final int[] userIds = (userId == UserHandle.USER_ALL) ? sUserManager.getUserIds()
|
final int[] userIds = (userId == UserHandle.USER_ALL) ? sUserManager.getUserIds()
|
||||||
: new int[] {userId};
|
: new int[] {userId};
|
||||||
for (int nextUserId : userIds) {
|
for (int nextUserId : userIds) {
|
||||||
@@ -19325,11 +19327,9 @@ public class PackageManagerService extends IPackageManager.Stub
|
|||||||
+ nextUserId);
|
+ nextUserId);
|
||||||
}
|
}
|
||||||
|
|
||||||
destroyAppDataLIF(pkg, userId,
|
destroyAppDataLIF(pkg, nextUserId,
|
||||||
StorageManager.FLAG_STORAGE_DE | StorageManager.FLAG_STORAGE_CE);
|
StorageManager.FLAG_STORAGE_DE | StorageManager.FLAG_STORAGE_CE);
|
||||||
destroyAppProfilesLIF(pkg, userId);
|
clearDefaultBrowserIfNeededForUser(ps.name, nextUserId);
|
||||||
clearDefaultBrowserIfNeededForUser(ps.name, userId);
|
|
||||||
removeKeystoreDataIfNeeded(nextUserId, ps.appId);
|
|
||||||
synchronized (mPackages) {
|
synchronized (mPackages) {
|
||||||
if (clearPackagePreferredActivitiesLPw(ps.name, nextUserId)) {
|
if (clearPackagePreferredActivitiesLPw(ps.name, nextUserId)) {
|
||||||
scheduleWritePackageRestrictionsLocked(nextUserId);
|
scheduleWritePackageRestrictionsLocked(nextUserId);
|
||||||
|
|||||||
Reference in New Issue
Block a user