From a7e47d5d344674f4174919c4ac51e5b9c74b5802 Mon Sep 17 00:00:00 2001 From: Christopher Tate Date: Mon, 1 Dec 2014 14:37:28 -0800 Subject: 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 --- .../backup/java/com/android/server/backup/BackupManagerService.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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(); -- cgit v1.1