summaryrefslogtreecommitdiffstats
path: root/services/backup
diff options
context:
space:
mode:
authorChristopher Tate <ctate@google.com>2015-02-25 02:30:34 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2015-02-25 02:30:37 +0000
commit6a873711cd1ed43c85f6cc93e8cf61fed7aeff0e (patch)
tree40c55208d3425c0d2457c4e3c93d704674c48a7e /services/backup
parentfa9ec310d8aac23bd085b0a7f0fe91fe2115181a (diff)
parent12f783d6c6155a65a87511e200206a81798aa2ed (diff)
downloadframeworks_base-6a873711cd1ed43c85f6cc93e8cf61fed7aeff0e.zip
frameworks_base-6a873711cd1ed43c85f6cc93e8cf61fed7aeff0e.tar.gz
frameworks_base-6a873711cd1ed43c85f6cc93e8cf61fed7aeff0e.tar.bz2
Merge "Don't crash when backup timeout races with agent completion"
Diffstat (limited to 'services/backup')
-rw-r--r--services/backup/java/com/android/server/backup/BackupManagerService.java17
1 files changed, 16 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 4d7ebed..acf4d39 100644
--- a/services/backup/java/com/android/server/backup/BackupManagerService.java
+++ b/services/backup/java/com/android/server/backup/BackupManagerService.java
@@ -2778,7 +2778,22 @@ public class BackupManagerService {
@Override
public void operationComplete() {
- // Okay, the agent successfully reported back to us!
+ // The agent reported back to us!
+
+ if (mBackupData == null) {
+ // This callback was racing with our timeout, so we've cleaned up the
+ // agent state already and are on to the next thing. We have nothing
+ // further to do here: agent state having been cleared means that we've
+ // initiated the appropriate next operation.
+ final String pkg = (mCurrentPackage != null)
+ ? mCurrentPackage.packageName : "[none]";
+ if (DEBUG) {
+ Slog.i(TAG, "Callback after agent teardown: " + pkg);
+ }
+ addBackupTrace("late opComplete; curPkg = " + pkg);
+ return;
+ }
+
final String pkgName = mCurrentPackage.packageName;
final long filepos = mBackupDataName.length();
FileDescriptor fd = mBackupData.getFileDescriptor();