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

Commit c0dbb614 authored by Chandan Nath's avatar Chandan Nath Committed by Android (Google) Code Review
Browse files

Merge "[Multi-user] Change PackageManagerService to pass in userId to restoreAtInstall."

parents d231ab27 4065d443
Loading
Loading
Loading
Loading
+5 −4
Original line number Diff line number Diff line
@@ -13774,14 +13774,15 @@ public class PackageManagerService extends IPackageManager.Stub
            IBackupManager bm = IBackupManager.Stub.asInterface(
                    ServiceManager.getService(Context.BACKUP_SERVICE));
            if (bm != null) {
                int userId = args.user.getIdentifier();
                if (DEBUG_INSTALL) {
                    Log.v(TAG, "token " + token + " to BM for possible restore");
                    Log.v(TAG, "token " + token + " to BM for possible restore for user " + userId);
                }
                Trace.asyncTraceBegin(TRACE_TAG_PACKAGE_MANAGER, "restore", token);
                try {
                    // TODO: http://b/22388012
                    if (bm.isBackupServiceActive(UserHandle.USER_SYSTEM)) {
                        bm.restoreAtInstall(res.pkg.applicationInfo.packageName, token);
                    if (bm.isBackupServiceActive(userId)) {
                        bm.restoreAtInstallForUser(
                                userId, res.pkg.applicationInfo.packageName, token);
                    } else {
                        doRestore = false;
                    }