Merge "Don't hold mPackages when clearing package state" into qt-dev
am: e299aa4ea4
Change-Id: I9c9f087fafbc977c2dc5950dd567ffd107b3bc45
This commit is contained in:
@@ -19151,22 +19151,22 @@ public class PackageManagerService extends IPackageManager.Stub
|
|||||||
final UserHandle user = action.user;
|
final UserHandle user = action.user;
|
||||||
final int flags = action.flags;
|
final int flags = action.flags;
|
||||||
final boolean systemApp = isSystemApp(ps);
|
final boolean systemApp = isSystemApp(ps);
|
||||||
synchronized (mPackages) {
|
|
||||||
|
|
||||||
if (ps.parentPackageName != null
|
if (ps.parentPackageName != null
|
||||||
&& (!systemApp || (flags & PackageManager.DELETE_SYSTEM_APP) != 0)) {
|
&& (!systemApp || (flags & PackageManager.DELETE_SYSTEM_APP) != 0)) {
|
||||||
if (DEBUG_REMOVE) {
|
if (DEBUG_REMOVE) {
|
||||||
Slog.d(TAG, "Uninstalled child package:" + packageName + " for user:"
|
Slog.d(TAG, "Uninstalled child package:" + packageName + " for user:"
|
||||||
+ ((user == null) ? UserHandle.USER_ALL : user));
|
+ ((user == null) ? UserHandle.USER_ALL : user));
|
||||||
}
|
}
|
||||||
final int removedUserId = (user != null) ? user.getIdentifier()
|
final int removedUserId = (user != null) ? user.getIdentifier()
|
||||||
: UserHandle.USER_ALL;
|
: UserHandle.USER_ALL;
|
||||||
|
|
||||||
clearPackageStateForUserLIF(ps, removedUserId, outInfo, flags);
|
clearPackageStateForUserLIF(ps, removedUserId, outInfo, flags);
|
||||||
|
synchronized (mPackages) {
|
||||||
markPackageUninstalledForUserLPw(ps, user);
|
markPackageUninstalledForUserLPw(ps, user);
|
||||||
scheduleWritePackageRestrictionsLocked(user);
|
scheduleWritePackageRestrictionsLocked(user);
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
final int userId = user == null ? UserHandle.USER_ALL : user.getIdentifier();
|
final int userId = user == null ? UserHandle.USER_ALL : user.getIdentifier();
|
||||||
@@ -19180,6 +19180,7 @@ public class PackageManagerService extends IPackageManager.Stub
|
|||||||
// its data. If this is a system app, we only allow this to happen if
|
// its data. If this is a system app, we only allow this to happen if
|
||||||
// they have set the special DELETE_SYSTEM_APP which requests different
|
// they have set the special DELETE_SYSTEM_APP which requests different
|
||||||
// semantics than normal for uninstalling system apps.
|
// semantics than normal for uninstalling system apps.
|
||||||
|
final boolean clearPackageStateAndReturn;
|
||||||
synchronized (mPackages) {
|
synchronized (mPackages) {
|
||||||
markPackageUninstalledForUserLPw(ps, user);
|
markPackageUninstalledForUserLPw(ps, user);
|
||||||
if (!systemApp) {
|
if (!systemApp) {
|
||||||
@@ -19190,15 +19191,14 @@ public class PackageManagerService extends IPackageManager.Stub
|
|||||||
// we need to do is clear this user's data and save that
|
// we need to do is clear this user's data and save that
|
||||||
// it is uninstalled.
|
// it is uninstalled.
|
||||||
if (DEBUG_REMOVE) Slog.d(TAG, "Still installed by other users");
|
if (DEBUG_REMOVE) Slog.d(TAG, "Still installed by other users");
|
||||||
clearPackageStateForUserLIF(ps, userId, outInfo, flags);
|
clearPackageStateAndReturn = true;
|
||||||
scheduleWritePackageRestrictionsLocked(user);
|
|
||||||
return;
|
|
||||||
} else {
|
} else {
|
||||||
// We need to set it back to 'installed' so the uninstall
|
// We need to set it back to 'installed' so the uninstall
|
||||||
// broadcasts will be sent correctly.
|
// broadcasts will be sent correctly.
|
||||||
if (DEBUG_REMOVE) Slog.d(TAG, "Not installed by other users, full delete");
|
if (DEBUG_REMOVE) Slog.d(TAG, "Not installed by other users, full delete");
|
||||||
ps.setInstalled(true, userId);
|
ps.setInstalled(true, userId);
|
||||||
mSettings.writeKernelMappingLPr(ps);
|
mSettings.writeKernelMappingLPr(ps);
|
||||||
|
clearPackageStateAndReturn = false;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// This is a system app, so we assume that the
|
// This is a system app, so we assume that the
|
||||||
@@ -19206,11 +19206,16 @@ public class PackageManagerService extends IPackageManager.Stub
|
|||||||
// we need to do is clear this user's data and save that
|
// we need to do is clear this user's data and save that
|
||||||
// it is uninstalled.
|
// it is uninstalled.
|
||||||
if (DEBUG_REMOVE) Slog.d(TAG, "Deleting system app");
|
if (DEBUG_REMOVE) Slog.d(TAG, "Deleting system app");
|
||||||
clearPackageStateForUserLIF(ps, userId, outInfo, flags);
|
clearPackageStateAndReturn = true;
|
||||||
scheduleWritePackageRestrictionsLocked(user);
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (clearPackageStateAndReturn) {
|
||||||
|
clearPackageStateForUserLIF(ps, userId, outInfo, flags);
|
||||||
|
synchronized (mPackages) {
|
||||||
|
scheduleWritePackageRestrictionsLocked(user);
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// If we are deleting a composite package for all users, keep track
|
// If we are deleting a composite package for all users, keep track
|
||||||
|
|||||||
Reference in New Issue
Block a user