summaryrefslogtreecommitdiffstats
path: root/services/backup
diff options
context:
space:
mode:
authorChristopher Tate <ctate@google.com>2014-12-01 14:37:28 -0800
committerChristopher Tate <ctate@google.com>2014-12-01 14:37:28 -0800
commita7e47d5d344674f4174919c4ac51e5b9c74b5802 (patch)
tree34b8d1f8a38225b2386d19e2b2b3a7a30ae06615 /services/backup
parent089f95f4483c95873cf0084c11cb23a0f5b32c3c (diff)
downloadframeworks_base-a7e47d5d344674f4174919c4ac51e5b9c74b5802.zip
frameworks_base-a7e47d5d344674f4174919c4ac51e5b9c74b5802.tar.gz
frameworks_base-a7e47d5d344674f4174919c4ac51e5b9c74b5802.tar.bz2
Don't crash if a system restore fails before constructing the PMBA
If a whole-system restore operation failed at just the wrong point, we'd wind up in the teardown code without a certain vital bit of it having been initialized, and crash on the null pointer. Now we recognize this failure mode and make sure not to do that. Bug 18574450 Change-Id: Ifa2c10ce16bb3c6bc916ed7151c5fd51b7225691
Diffstat (limited to 'services/backup')
-rw-r--r--services/backup/java/com/android/server/backup/BackupManagerService.java2
1 files changed, 1 insertions, 1 deletions
diff --git a/services/backup/java/com/android/server/backup/BackupManagerService.java b/services/backup/java/com/android/server/backup/BackupManagerService.java
index 6c2681b..6b8b5b1 100644
--- a/services/backup/java/com/android/server/backup/BackupManagerService.java
+++ b/services/backup/java/com/android/server/backup/BackupManagerService.java
@@ -7664,7 +7664,7 @@ if (MORE_DEBUG) Slog.v(TAG, " + got " + nRead + "; now wanting " + (size - soF
// If this was a full-system restore, record the ancestral
// dataset information
- if (mIsSystemRestore) {
+ if (mIsSystemRestore && mPmAgent != null) {
mAncestralPackages = mPmAgent.getRestoredPackages();
mAncestralToken = mToken;
writeRestoreTokens();