Start agent in correct mode for adb k/v restore

Previously we always started the agent in "dolly" mode, which meant that
the application context might not be what the agent was expecting.

Bug: 62524964
Test: Manual
Change-Id: I6cd2fafcac97f7ca01a6e172325968d79cc01194
This commit is contained in:
Bryan Mawhinney
2017-06-16 14:29:48 +01:00
parent 84a333c7eb
commit 4fee93109a
2 changed files with 6 additions and 2 deletions

View File

@@ -7562,7 +7562,9 @@ if (MORE_DEBUG) Slog.v(TAG, " + got " + nRead + "; now wanting " + (size - soF
// All set; now set up the IPC and launch the agent
setUpPipes();
mAgent = bindToAgentSynchronous(mTargetApp,
ApplicationThreadConstants.BACKUP_MODE_RESTORE_FULL);
FullBackup.KEY_VALUE_DATA_TOKEN.equals(info.domain)
? ApplicationThreadConstants.BACKUP_MODE_INCREMENTAL
: ApplicationThreadConstants.BACKUP_MODE_RESTORE_FULL);
mAgentPackage = pkg;
} catch (IOException e) {
// fall through to error handling

View File

@@ -610,7 +610,9 @@ public class PerformAdbRestoreTask implements Runnable {
// All set; now set up the IPC and launch the agent
setUpPipes();
mAgent = mBackupManagerService.bindToAgentSynchronous(mTargetApp,
ApplicationThreadConstants.BACKUP_MODE_RESTORE_FULL);
FullBackup.KEY_VALUE_DATA_TOKEN.equals(info.domain)
? ApplicationThreadConstants.BACKUP_MODE_INCREMENTAL
: ApplicationThreadConstants.BACKUP_MODE_RESTORE_FULL);
mAgentPackage = pkg;
} catch (IOException e) {
// fall through to error handling