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

Commit 9dc06cdb authored by Henry Liu's avatar Henry Liu
Browse files

Fix default browser is reset after restoring

Do not clear default browser state if the browser is restored
from user's backup

Bug: 65141238

Test: Manual
Change-Id: I567e930bf5a6bb2ab9c505638d29181ad0f63972
parent ff9f2cca
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.