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

Commit 47303ec6 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Tear down agent after preflight rejection" into oc-dr1-dev

parents 6a6d63be e989348c
Loading
Loading
Loading
Loading
+10 −1
Original line number Diff line number Diff line
@@ -4871,6 +4871,7 @@ public class BackupManagerService implements BackupManagerServiceInterface {
                final int N = mPackages.size();
                final byte[] buffer = new byte[8192];
                for (int i = 0; i < N; i++) {
                    mBackupRunner = null;
                    PackageInfo currentPackage = mPackages.get(i);
                    String packageName = currentPackage.packageName;
                    if (DEBUG) {
@@ -5054,7 +5055,13 @@ public class BackupManagerService implements BackupManagerServiceInterface {
                        }
                        EventLog.writeEvent(EventLogTags.FULL_BACKUP_AGENT_FAILURE, packageName,
                                "transport rejected");
                        // Do nothing, clean up, and continue looping.
                        // This failure state can come either a-priori from the transport, or
                        // from the preflight pass.  If we got as far as preflight, we now need
                        // to tear down the target process.
                        if (mBackupRunner != null) {
                            tearDownAgentAndKill(currentPackage.applicationInfo);
                        }
                        // ... and continue looping.
                    } else if (backupPackageStatus == BackupTransport.TRANSPORT_QUOTA_EXCEEDED) {
                        sendBackupOnPackageResult(mBackupObserver, packageName,
                                BackupManager.ERROR_TRANSPORT_QUOTA_EXCEEDED);
@@ -5063,6 +5070,7 @@ public class BackupManagerService implements BackupManagerServiceInterface {
                            EventLog.writeEvent(EventLogTags.FULL_BACKUP_QUOTA_EXCEEDED,
                                    packageName);
                        }
                        tearDownAgentAndKill(currentPackage.applicationInfo);
                        // Do nothing, clean up, and continue looping.
                    } else if (backupPackageStatus == BackupTransport.AGENT_ERROR) {
                        sendBackupOnPackageResult(mBackupObserver, packageName,
@@ -5086,6 +5094,7 @@ public class BackupManagerService implements BackupManagerServiceInterface {
                        EventLog.writeEvent(EventLogTags.FULL_BACKUP_TRANSPORT_FAILURE);
                        // Abort entire backup pass.
                        backupRunStatus = BackupManager.ERROR_TRANSPORT_ABORTED;
                        tearDownAgentAndKill(currentPackage.applicationInfo);
                        return;
                    } else {
                        // Success!