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

Commit 3e0557c0 authored by Satoshi Niwa's avatar Satoshi Niwa Committed by Android (Google) Code Review
Browse files

Merge "Fix Backup/Restore confirmation dialog for HSUM multi-user scenarios." into main

parents b227080a f4c14673
Loading
Loading
Loading
Loading
+2 −4
Original line number Diff line number Diff line
@@ -800,8 +800,7 @@ public class BackupManagerService extends IBackupManager.Stub implements BackupM
            return false;
        }
        UserBackupManagerService userBackupManagerService =
                getServiceForUserIfCallerHasPermission(
                        UserHandle.USER_SYSTEM, "setBackupPassword()");
                getServiceForUserIfCallerHasPermission(userId, "setBackupPassword()");

        return userBackupManagerService != null
                && userBackupManagerService.setBackupPassword(currentPassword, newPassword);
@@ -815,8 +814,7 @@ public class BackupManagerService extends IBackupManager.Stub implements BackupM
            return false;
        }
        UserBackupManagerService userBackupManagerService =
                getServiceForUserIfCallerHasPermission(
                        UserHandle.USER_SYSTEM, "hasBackupPassword()");
                getServiceForUserIfCallerHasPermission(userId, "hasBackupPassword()");

        return userBackupManagerService != null && userBackupManagerService.hasBackupPassword();
    }
+3 −1
Original line number Diff line number Diff line
@@ -2820,6 +2820,7 @@ public class UserBackupManagerService {
        }
    }

    @SuppressWarnings("AndroidFrameworkRequiresPermission")
    private boolean startConfirmationUi(int token, String action) {
        try {
            Intent confIntent = new Intent(action);
@@ -2828,7 +2829,8 @@ public class UserBackupManagerService {
                    "com.android.backupconfirm.BackupRestoreConfirmation");
            confIntent.putExtra(FullBackup.CONF_TOKEN_INTENT_EXTRA, token);
            confIntent.addFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP);
            mContext.startActivityAsUser(confIntent, UserHandle.SYSTEM);
            mContext.startActivityAsUser(confIntent, UserHandle.of(mUserId));
            Slog.i(TAG, mLogIdMsg + "Starting confirmation UI");
        } catch (ActivityNotFoundException e) {
            return false;
        }