diff options
| author | 2015-07-30 18:12:43 +0000 | |
|---|---|---|
| committer | 2015-07-30 18:12:43 +0000 | |
| commit | 1ad82779bea52865055db70ead52a8a360fcdba8 (patch) | |
| tree | 834ff651d99f64577c6372f6584abf48a3d46f75 | |
| parent | 637e4ab8372183ebe85d9ffdfe8a06d331a2d62f (diff) | |
| parent | 5f70b3b1d3360dcfa2716d610c04efa3e309521e (diff) | |
am 5f70b3b1: am e5b25915: am e625b631: am 4de7b0ff: am 74a0744e: Merge "Fix issues around process teardown after full-data restore" into mnc-dev
* commit '5f70b3b1d3360dcfa2716d610c04efa3e309521e':
Fix issues around process teardown after full-data restore
| -rw-r--r-- | services/backup/java/com/android/server/backup/BackupManagerService.java | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/services/backup/java/com/android/server/backup/BackupManagerService.java b/services/backup/java/com/android/server/backup/BackupManagerService.java index a0443188f80a..6481adadeebe 100644 --- a/services/backup/java/com/android/server/backup/BackupManagerService.java +++ b/services/backup/java/com/android/server/backup/BackupManagerService.java @@ -8091,6 +8091,7 @@ if (MORE_DEBUG) Slog.v(TAG, " + got " + nRead + "; now wanting " + (size - soF keyValueAgentCleanup(); } + // TODO: clean up naming; this is now used at finish by both k/v and stream restores void keyValueAgentCleanup() { mBackupDataName.delete(); mStageName.delete(); @@ -8126,8 +8127,17 @@ if (MORE_DEBUG) Slog.v(TAG, " + got " + nRead + "; now wanting " + (size - soF // usual full initialization. Note that this is only done for // full-system restores: when a single app has requested a restore, // it is explicitly not killed following that operation. - if (mTargetPackage == null && (mCurrentPackage.applicationInfo.flags - & ApplicationInfo.FLAG_KILL_AFTER_RESTORE) != 0) { + // + // We execute this kill when these conditions hold: + // 1. the app did not request its own restore (mTargetPackage == null), and either + // 2a. the app is a full-data target (TYPE_FULL_STREAM) or + // b. the app does not state android:killAfterRestore="false" in its manifest + final int appFlags = mCurrentPackage.applicationInfo.flags; + final boolean killAfterRestore = + (mRestoreDescription.getDataType() == RestoreDescription.TYPE_FULL_STREAM) + || ((appFlags & ApplicationInfo.FLAG_KILL_AFTER_RESTORE) != 0); + + if (mTargetPackage == null && killAfterRestore) { if (DEBUG) Slog.d(TAG, "Restore complete, killing host process of " + mCurrentPackage.applicationInfo.processName); mActivityManager.killApplicationProcess( |