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

Commit 089a2471 authored by Anton Philippov's avatar Anton Philippov Committed by android-build-merger
Browse files

Add null check in BackupManagerService$PerformBackupTask.handleCancel()

am: bc44678f

Change-Id: Ic075a99dfff968cd9c2061575f876afabbe1501a
parents 3d981130 bc44678f
Loading
Loading
Loading
Loading
+10 −8
Original line number Diff line number Diff line
@@ -3537,21 +3537,23 @@ public class BackupManagerService {
                    return;
                }
                mCancelAll = cancelAll;
                // Whoops, the current agent timed out running doBackup().  Tidy up and restage
                // it for the next time we run a backup pass.
                // !!! TODO: keep track of failure counts per agent, and blacklist those which
                // fail repeatedly (i.e. have proved themselves to be buggy).
                Slog.e(TAG, "Cancel backing up " + mCurrentPackage.packageName);
                EventLog.writeEvent(EventLogTags.BACKUP_AGENT_FAILURE, mCurrentPackage.packageName);
                final String logPackageName = (mCurrentPackage != null)
                        ? mCurrentPackage.packageName
                        : "no_package_yet";
                Slog.i(TAG, "Cancel backing up " + logPackageName);
                EventLog.writeEvent(EventLogTags.BACKUP_AGENT_FAILURE, logPackageName);
                addBackupTrace("cancel of " + logPackageName + ", cancelAll=" + cancelAll);
                mMonitor = monitorEvent(mMonitor,
                        BackupManagerMonitor.LOG_EVENT_ID_KEY_VALUE_BACKUP_CANCEL,
                        mCurrentPackage, BackupManagerMonitor.LOG_EVENT_CATEGORY_AGENT,
                        putMonitoringExtra(null, BackupManagerMonitor.EXTRA_LOG_CANCEL_ALL,
                                mCancelAll));
                addBackupTrace(
                        "cancel of " + mCurrentPackage.packageName + ", cancelAll=" + cancelAll);
                errorCleanup();
                if (!cancelAll) {
                    // The current agent either timed out or was cancelled running doBackup().
                    // Restage it for the next time we run a backup pass.
                    // !!! TODO: keep track of failure counts per agent, and blacklist those which
                    // fail repeatedly (i.e. have proved themselves to be buggy).
                    executeNextState(
                            mQueue.isEmpty() ? BackupState.FINAL : BackupState.RUNNING_QUEUE);
                    dataChangedImpl(mCurrentPackage.packageName);