am 71ab245a: Merge "Fix issue #11536426 DO NOT MERGE" into klp-dev

* commit '71ab245a0d7830791cb89ec9130313620a1ee029':
  Fix issue #11536426 DO NOT MERGE
This commit is contained in:
Dianne Hackborn
2014-03-06 19:49:52 +00:00
committed by Android Git Automerger

View File

@ -1328,7 +1328,7 @@ public final class ActivityManagerService extends ActivityManagerNative
String pkg = bundle.getString("pkg"); String pkg = bundle.getString("pkg");
String reason = bundle.getString("reason"); String reason = bundle.getString("reason");
forceStopPackageLocked(pkg, appid, restart, false, true, false, forceStopPackageLocked(pkg, appid, restart, false, true, false,
UserHandle.USER_ALL, reason); false, UserHandle.USER_ALL, reason);
} }
} break; } break;
case FINALIZE_PENDING_INTENT_MSG: { case FINALIZE_PENDING_INTENT_MSG: {
@ -4494,7 +4494,7 @@ public final class ActivityManagerService extends ActivityManagerNative
private void forceStopPackageLocked(final String packageName, int uid, String reason) { private void forceStopPackageLocked(final String packageName, int uid, String reason) {
forceStopPackageLocked(packageName, UserHandle.getAppId(uid), false, forceStopPackageLocked(packageName, UserHandle.getAppId(uid), false,
false, true, false, UserHandle.getUserId(uid), reason); false, true, false, false, UserHandle.getUserId(uid), reason);
Intent intent = new Intent(Intent.ACTION_PACKAGE_RESTARTED, Intent intent = new Intent(Intent.ACTION_PACKAGE_RESTARTED,
Uri.fromParts("package", packageName, null)); Uri.fromParts("package", packageName, null));
if (!mProcessesReady) { if (!mProcessesReady) {
@ -4510,7 +4510,7 @@ public final class ActivityManagerService extends ActivityManagerNative
} }
private void forceStopUserLocked(int userId, String reason) { private void forceStopUserLocked(int userId, String reason) {
forceStopPackageLocked(null, -1, false, false, true, false, userId, reason); forceStopPackageLocked(null, -1, false, false, true, false, false, userId, reason);
Intent intent = new Intent(Intent.ACTION_USER_STOPPED); Intent intent = new Intent(Intent.ACTION_USER_STOPPED);
intent.addFlags(Intent.FLAG_RECEIVER_REGISTERED_ONLY intent.addFlags(Intent.FLAG_RECEIVER_REGISTERED_ONLY
| Intent.FLAG_RECEIVER_FOREGROUND); | Intent.FLAG_RECEIVER_FOREGROUND);
@ -4595,7 +4595,7 @@ public final class ActivityManagerService extends ActivityManagerNative
private final boolean forceStopPackageLocked(String name, int appId, private final boolean forceStopPackageLocked(String name, int appId,
boolean callerWillRestart, boolean purgeCache, boolean doit, boolean callerWillRestart, boolean purgeCache, boolean doit,
boolean evenPersistent, int userId, String reason) { boolean evenPersistent, boolean uninstalling, int userId, String reason) {
int i; int i;
int N; int N;
@ -4687,7 +4687,7 @@ public final class ActivityManagerService extends ActivityManagerNative
// Remove transient permissions granted from/to this package/user // Remove transient permissions granted from/to this package/user
removeUriPermissionsForPackageLocked(name, userId, false); removeUriPermissionsForPackageLocked(name, userId, false);
if (name == null) { if (name == null || uninstalling) {
// Remove pending intents. For now we only do this when force // Remove pending intents. For now we only do this when force
// stopping users, because we have some problems when doing this // stopping users, because we have some problems when doing this
// for packages -- app widgets are not currently cleaned up for // for packages -- app widgets are not currently cleaned up for
@ -5132,7 +5132,7 @@ public final class ActivityManagerService extends ActivityManagerNative
if (pkgs != null) { if (pkgs != null) {
for (String pkg : pkgs) { for (String pkg : pkgs) {
synchronized (ActivityManagerService.this) { synchronized (ActivityManagerService.this) {
if (forceStopPackageLocked(pkg, -1, false, false, false, false, 0, if (forceStopPackageLocked(pkg, -1, false, false, false, false, false, 0,
"finished booting")) { "finished booting")) {
setResultCode(Activity.RESULT_OK); setResultCode(Activity.RESULT_OK);
return; return;
@ -8445,7 +8445,7 @@ public final class ActivityManagerService extends ActivityManagerNative
mDebugTransient = !persistent; mDebugTransient = !persistent;
if (packageName != null) { if (packageName != null) {
forceStopPackageLocked(packageName, -1, false, false, true, true, forceStopPackageLocked(packageName, -1, false, false, true, true,
UserHandle.USER_ALL, "set debug app"); false, UserHandle.USER_ALL, "set debug app");
} }
} }
} finally { } finally {
@ -13373,7 +13373,7 @@ public final class ActivityManagerService extends ActivityManagerNative
String list[] = intent.getStringArrayExtra(Intent.EXTRA_CHANGED_PACKAGE_LIST); String list[] = intent.getStringArrayExtra(Intent.EXTRA_CHANGED_PACKAGE_LIST);
if (list != null && (list.length > 0)) { if (list != null && (list.length > 0)) {
for (String pkg : list) { for (String pkg : list) {
forceStopPackageLocked(pkg, -1, false, true, true, false, userId, forceStopPackageLocked(pkg, -1, false, true, true, false, false, userId,
"storage unmount"); "storage unmount");
} }
sendPackageBroadcastLocked( sendPackageBroadcastLocked(
@ -13385,10 +13385,13 @@ public final class ActivityManagerService extends ActivityManagerNative
if (data != null && (ssp=data.getSchemeSpecificPart()) != null) { if (data != null && (ssp=data.getSchemeSpecificPart()) != null) {
boolean removed = Intent.ACTION_PACKAGE_REMOVED.equals( boolean removed = Intent.ACTION_PACKAGE_REMOVED.equals(
intent.getAction()); intent.getAction());
boolean fullUninstall = removed &&
!intent.getBooleanExtra(Intent.EXTRA_REPLACING, false);
if (!intent.getBooleanExtra(Intent.EXTRA_DONT_KILL_APP, false)) { if (!intent.getBooleanExtra(Intent.EXTRA_DONT_KILL_APP, false)) {
forceStopPackageLocked(ssp, UserHandle.getAppId( forceStopPackageLocked(ssp, UserHandle.getAppId(
intent.getIntExtra(Intent.EXTRA_UID, -1)), false, true, true, intent.getIntExtra(Intent.EXTRA_UID, -1)), false, true, true,
false, userId, removed ? "pkg removed" : "pkg changed"); false, fullUninstall, userId,
removed ? "pkg removed" : "pkg changed");
} }
if (removed) { if (removed) {
sendPackageBroadcastLocked(IApplicationThread.PACKAGE_REMOVED, sendPackageBroadcastLocked(IApplicationThread.PACKAGE_REMOVED,
@ -13866,7 +13869,7 @@ public final class ActivityManagerService extends ActivityManagerNative
final long origId = Binder.clearCallingIdentity(); final long origId = Binder.clearCallingIdentity();
// Instrumentation can kill and relaunch even persistent processes // Instrumentation can kill and relaunch even persistent processes
forceStopPackageLocked(ii.targetPackage, -1, true, false, true, true, userId, forceStopPackageLocked(ii.targetPackage, -1, true, false, true, true, false, userId,
"start instr"); "start instr");
ProcessRecord app = addAppLocked(ai, false); ProcessRecord app = addAppLocked(ai, false);
app.instrumentationClass = className; app.instrumentationClass = className;
@ -13934,7 +13937,7 @@ public final class ActivityManagerService extends ActivityManagerNative
app.instrumentationProfileFile = null; app.instrumentationProfileFile = null;
app.instrumentationArguments = null; app.instrumentationArguments = null;
forceStopPackageLocked(app.info.packageName, -1, false, false, true, true, app.userId, forceStopPackageLocked(app.info.packageName, -1, false, false, true, true, false, app.userId,
"finished inst"); "finished inst");
} }