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

Commit 6606acd6 authored by Christopher Tate's avatar Christopher Tate Committed by The Android Automerger
Browse files

Apply default link-handling policy at OTA from pre-M

Not just at first (wiped) boot.

Bug 23744303

Change-Id: I9ab42f7b081e92231d89b3c97935135c3dd901d4
parent 776c0908
Loading
Loading
Loading
Loading
+13 −9
Original line number Diff line number Diff line
@@ -2283,16 +2283,16 @@ public class PackageManagerService extends IPackageManager.Stub {
            }
            updatePermissionsLPw(null, null, updateFlags);
            ver.sdkVersion = mSdkVersion;
            // clear only after permissions have been updated
            mExistingSystemPackages.clear();
            mPromoteSystemApps = false;
            // If this is the first boot, and it is a normal boot, then
            // we need to initialize the default preferred apps.
            if (!mRestoredSettings && !onlyCore) {
                mSettings.applyDefaultPreferredAppsLPw(this, UserHandle.USER_OWNER);
                applyFactoryDefaultBrowserLPw(UserHandle.USER_OWNER);
                primeDomainVerificationsLPw(UserHandle.USER_OWNER);
            // If this is the first boot or an update from pre-M, and it is a normal
            // boot, then we need to initialize the default preferred apps across
            // all defined users.
            if (!onlyCore && (mPromoteSystemApps || !mRestoredSettings)) {
                for (UserInfo user : sUserManager.getUsers(true)) {
                    mSettings.applyDefaultPreferredAppsLPw(this, user.id);
                    applyFactoryDefaultBrowserLPw(user.id);
                    primeDomainVerificationsLPw(user.id);
                }
            }
            // If this is first boot after an OTA, and a normal boot, then
@@ -2310,6 +2310,10 @@ public class PackageManagerService extends IPackageManager.Stub {
            checkDefaultBrowser();
            // clear only after permissions and other defaults have been updated
            mExistingSystemPackages.clear();
            mPromoteSystemApps = false;
            // All the changes are done during package scanning.
            ver.databaseVersion = Settings.CURRENT_DATABASE_VERSION;