Get OperationType from transport

This CL was merged earlier (ag/13484966) and then reverted due to the
new behaviour breaking D2D transfers.

Merge it again with all changes being controlled by a flag (default
off), see UserBackupManagerService:getOperationTypeFromTransport in this
CL. View the diff between patchsets 1 and 2 to only see what's changed
between the earlier reverted code and the fixed version of it (i.e. with
the flag).

The flag can be changed via adb for now, we will set it to true by
default once other components are ready.

Bug: 174216309
Test: atest UserBackupManagerServiceTest
Change-Id: I7473c9b4f8d0c4d20155be76930279184ffb17c4
This commit is contained in:
Ruslan Tkhakokhov
2021-02-20 10:43:21 +00:00
parent c3bf79a2cd
commit a2fdf3f5fb
7 changed files with 111 additions and 117 deletions

View File

@@ -19,7 +19,6 @@ package com.android.commands.bmgr;
import android.annotation.IntDef;
import android.annotation.UserIdInt;
import android.app.backup.BackupManager;
import android.app.backup.BackupManager.OperationType;
import android.app.backup.BackupManagerMonitor;
import android.app.backup.BackupProgress;
import android.app.backup.BackupTransport;
@@ -667,7 +666,7 @@ public class Bmgr {
// The rest of the 'list' options work with a restore session on the current transport
try {
mRestore = mBmgr.beginRestoreSessionForUser(userId, null, null, OperationType.BACKUP);
mRestore = mBmgr.beginRestoreSessionForUser(userId, null, null);
if (mRestore == null) {
System.err.println(BMGR_ERR_NO_RESTORESESSION_FOR_USER + userId);
return;
@@ -822,7 +821,7 @@ public class Bmgr {
try {
boolean didRestore = false;
mRestore = mBmgr.beginRestoreSessionForUser(userId, null, null, OperationType.BACKUP);
mRestore = mBmgr.beginRestoreSessionForUser(userId, null, null);
if (mRestore == null) {
System.err.println(BMGR_ERR_NO_RESTORESESSION_FOR_USER + userId);
return;