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

Commit 5af0a45b authored by Henry Liu's avatar Henry Liu Committed by Android (Google) Code Review
Browse files

Merge "Fix default browser is reset after restoring"

parents 4ba3ff8e 9dc06cdb
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -2143,8 +2143,14 @@ public class PackageManagerService extends IPackageManager.Stub
                        // app's nature doesn't depend on the user, so we can just check
                        // its browser nature in any user and generalize.
                        if (packageIsBrowser(packageName, userId)) {
                            // If this browser is restored from user's backup, do not clear
                            // default-browser state for this user
                            final PackageSetting pkgSetting = mSettings.mPackages.get(packageName);
                            if (pkgSetting.getInstallReason(userId)
                                    != PackageManager.INSTALL_REASON_DEVICE_RESTORE) {
                                mSettings.setDefaultBrowserPackageNameLPw(null, userId);
                            }
                        }
                        // We may also need to apply pending (restored) runtime
                        // permission grants within these users.