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

Commit ddc72dd3 authored by Shreyas Basarge's avatar Shreyas Basarge Committed by Android (Google) Code Review
Browse files

Merge "Better iteration over mCurrentOperations in cancelBackups"

parents ba422045 0277db47
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -2400,13 +2400,18 @@ public class BackupManagerService {
        }
        final long oldToken = Binder.clearCallingIdentity();
        try {
            List<Integer> operationsToCancel = new ArrayList<>();
            synchronized (mCurrentOpLock) {
                for (int i = 0; i < mCurrentOperations.size(); i++) {
                    Operation op = mCurrentOperations.valueAt(i);
                    int token = mCurrentOperations.keyAt(i);
                    if (op.type == OP_TYPE_BACKUP) {
                        handleCancel(token, true /* cancelAll */);
                        operationsToCancel.add(token);
                    }
                }

                for (Integer token : operationsToCancel) {
                    handleCancel(token, true /* cancelAll */);
                }
            }