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

Commit b09a630d authored by Anton Philippov's avatar Anton Philippov
Browse files

Call removeMessages() only for certain operations in BackupManagerService#handleCancel()

Only remove messages of types OP_TYPE_BACKUP_WAIT and OP_TYPE_RESTORE_WAIT, since OP_TYPE_BACKUP cannot time out and doesn't require cancellation.

This will prevent some unncecessary (false) warnings in logcat.

Bug: 36570881
Test: manual
Change-Id: I72ecf98438fff18616354b04638b7db5c943aa61
parent 0db9724b
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -2625,9 +2625,13 @@ public class BackupManagerService {
                // 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();
        }