Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a7924a67 authored by Michal Karpinski's avatar Michal Karpinski
Browse files

[RefactoredBMS] Call removeMessages() only for certain operations in...

[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
parent bcd3f07c
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -1759,9 +1759,13 @@ 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.
                // 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();
        }