Merge "Better iteration over mCurrentOperations in cancelBackups"
This commit is contained in:
committed by
Android (Google) Code Review
commit
ddc72dd32e
@@ -2400,14 +2400,19 @@ 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 */);
|
||||
}
|
||||
}
|
||||
|
||||
// We don't want the backup jobs to kick in any time soon.
|
||||
|
||||
Reference in New Issue
Block a user