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

Commit 9d379505 authored by Annie Meng's avatar Annie Meng
Browse files

[Multi-user] Route USER_ALL calls to USER_SYSTEM for restoreAtInstall

Before ag/5882734 where we introduced the user param for
restoreAtInstall(), PackageManager would route all calls to the system
user including USER_ALL. Continue to route USER_ALL to USER_SYSTEM as
CTS infrastructure installs packages with USER_ALL.

Bug: 122954632
Test: atest CtsBackupHostTestCases
Change-Id: Icb674435f70adcd4b0349f13acc1ff83185575ac
parent f8e7ff91
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -13778,6 +13778,11 @@ public class PackageManagerService extends IPackageManager.Stub
                    ServiceManager.getService(Context.BACKUP_SERVICE));
            if (bm != null) {
                int userId = args.user.getIdentifier();
                // For backwards compatibility as USER_ALL previously routed directly to USER_SYSTEM
                // in the BackupManager. USER_ALL is used in compatibility tests.
                if (userId == UserHandle.USER_ALL) {
                    userId = UserHandle.USER_SYSTEM;
                }
                if (DEBUG_INSTALL) {
                    Log.v(TAG, "token " + token + " to BM for possible restore for user " + userId);
                }