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

Commit 1ff9475e authored by Christopher Tate's avatar Christopher Tate Committed by android-build-merger
Browse files

Merge "Tear down agent after preflight rejection" into oc-dr1-dev am: 47303ec6

am: 19bb6c35

Change-Id: I17cbc0a91b65d755965ac4479d7656a7dbeef109
parents 6fef520a 19bb6c35
Loading
Loading
Loading
Loading
+10 −1
Original line number Diff line number Diff line
@@ -4875,6 +4875,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) {
@@ -5058,7 +5059,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);
@@ -5067,6 +5074,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,
@@ -5090,6 +5098,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!