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

Commit ee21301a authored by Android Build Merger (Role)'s avatar Android Build Merger (Role) Committed by Android (Google) Code Review
Browse files

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

Merge "Merge "Tear down agent after preflight rejection" into oc-dr1-dev am: 47303ec6 am: 19bb6c35"
parents a49d2eed 1ff9475e
Loading
Loading
Loading
Loading
+10 −1
Original line number Original line Diff line number Diff line
@@ -4875,6 +4875,7 @@ public class BackupManagerService implements BackupManagerServiceInterface {
                final int N = mPackages.size();
                final int N = mPackages.size();
                final byte[] buffer = new byte[8192];
                final byte[] buffer = new byte[8192];
                for (int i = 0; i < N; i++) {
                for (int i = 0; i < N; i++) {
                    mBackupRunner = null;
                    PackageInfo currentPackage = mPackages.get(i);
                    PackageInfo currentPackage = mPackages.get(i);
                    String packageName = currentPackage.packageName;
                    String packageName = currentPackage.packageName;
                    if (DEBUG) {
                    if (DEBUG) {
@@ -5058,7 +5059,13 @@ public class BackupManagerService implements BackupManagerServiceInterface {
                        }
                        }
                        EventLog.writeEvent(EventLogTags.FULL_BACKUP_AGENT_FAILURE, packageName,
                        EventLog.writeEvent(EventLogTags.FULL_BACKUP_AGENT_FAILURE, packageName,
                                "transport rejected");
                                "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) {
                    } else if (backupPackageStatus == BackupTransport.TRANSPORT_QUOTA_EXCEEDED) {
                        sendBackupOnPackageResult(mBackupObserver, packageName,
                        sendBackupOnPackageResult(mBackupObserver, packageName,
                                BackupManager.ERROR_TRANSPORT_QUOTA_EXCEEDED);
                                BackupManager.ERROR_TRANSPORT_QUOTA_EXCEEDED);
@@ -5067,6 +5074,7 @@ public class BackupManagerService implements BackupManagerServiceInterface {
                            EventLog.writeEvent(EventLogTags.FULL_BACKUP_QUOTA_EXCEEDED,
                            EventLog.writeEvent(EventLogTags.FULL_BACKUP_QUOTA_EXCEEDED,
                                    packageName);
                                    packageName);
                        }
                        }
                        tearDownAgentAndKill(currentPackage.applicationInfo);
                        // Do nothing, clean up, and continue looping.
                        // Do nothing, clean up, and continue looping.
                    } else if (backupPackageStatus == BackupTransport.AGENT_ERROR) {
                    } else if (backupPackageStatus == BackupTransport.AGENT_ERROR) {
                        sendBackupOnPackageResult(mBackupObserver, packageName,
                        sendBackupOnPackageResult(mBackupObserver, packageName,
@@ -5090,6 +5098,7 @@ public class BackupManagerService implements BackupManagerServiceInterface {
                        EventLog.writeEvent(EventLogTags.FULL_BACKUP_TRANSPORT_FAILURE);
                        EventLog.writeEvent(EventLogTags.FULL_BACKUP_TRANSPORT_FAILURE);
                        // Abort entire backup pass.
                        // Abort entire backup pass.
                        backupRunStatus = BackupManager.ERROR_TRANSPORT_ABORTED;
                        backupRunStatus = BackupManager.ERROR_TRANSPORT_ABORTED;
                        tearDownAgentAndKill(currentPackage.applicationInfo);
                        return;
                        return;
                    } else {
                    } else {
                        // Success!
                        // Success!