summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Michal Karpinski <mkarpinski@google.com> 2017-09-18 12:20:29 +0100
committer Michal Karpinski <mkarpinski@google.com> 2017-09-18 12:20:34 +0100
commita7924a6795556d29d8a4c49b0781d2b43a5639dd (patch)
tree5bff30e44a2321bc049aaafb1d89019ca6d33628
parentbcd3f07cc2514f1304580e0a4cb7d140d7178018 (diff)
[RefactoredBMS] Call removeMessages() only for certain operations in RefactoredBackupManagerService#handleCancel()
This CL replicates ag/2147459 in RefactoredBMS. Test: adb shell am instrument -w -e package com.android.server.backup com.android.frameworks.servicestests/android.support.test.runner.AndroidJUnitRunner Bug: 37973765 Change-Id: I55d1825477ce82c47fd5850bf00f34ee8c1b9fc0
-rw-r--r--services/backup/java/com/android/server/backup/RefactoredBackupManagerService.java8
1 files changed, 6 insertions, 2 deletions
diff --git a/services/backup/java/com/android/server/backup/RefactoredBackupManagerService.java b/services/backup/java/com/android/server/backup/RefactoredBackupManagerService.java
index 141f9207b314..70cdf09459fc 100644
--- a/services/backup/java/com/android/server/backup/RefactoredBackupManagerService.java
+++ b/services/backup/java/com/android/server/backup/RefactoredBackupManagerService.java
@@ -1759,8 +1759,12 @@ public class RefactoredBackupManagerService implements BackupManagerServiceInter
// Can't delete op from mCurrentOperations here. waitUntilOperationComplete may be
// called after we receive cancel here. We need this op's state there.
- // Remove all pending timeout messages for this operation type.
- mBackupHandler.removeMessages(getMessageIdForOperationType(op.type));
+ // Remove all pending timeout messages of types OP_TYPE_BACKUP_WAIT and
+ // OP_TYPE_RESTORE_WAIT. On the other hand, OP_TYPE_BACKUP cannot time out and
+ // doesn't require cancellation.
+ if (op.type == OP_TYPE_BACKUP_WAIT || op.type == OP_TYPE_RESTORE_WAIT) {
+ mBackupHandler.removeMessages(getMessageIdForOperationType(op.type));
+ }
}
mCurrentOpLock.notifyAll();
}