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

Commit c3dbf3fd authored by Pawan Wagh's avatar Pawan Wagh
Browse files

Reset mPageSizeAppCompatFlags while upgrading

previous value of mPageSizeAppCompatFlags remains the same
when package is updagraded. Reset the value in case of the upgrade.

Test: m FileSystemUtilsTests && atest -c FileSystemUtilsTests
Test: Install 4 KB and 16 KB aligned versions of the same app.
Bug: 430567227
Flag: EXEMPT bug_fix
Change-Id: I56a70b8b75c0220a7e74b48033533487ecb83241
parent 49c6da52
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -1645,6 +1645,16 @@ public class PackageSetting extends SettingBase implements PackageStateInternal
        return this;
    }


    /**
     * Clear the page size app compat flags.
     */
    public PackageSetting clearPageSizeAppCompatFlags() {
        this.mPageSizeAppCompatFlags = ApplicationInfo.PAGE_SIZE_APP_COMPAT_FLAG_UNDEFINED;
        onChanged();
        return this;
    }

    /**
     * @see Set page size app compat mode.
     */
+6 −0
Original line number Diff line number Diff line
@@ -437,6 +437,12 @@ final class ScanPackageUtils {
                pkgSetting.getInstallSource().mInitiatingPackageName);
        }

        // If package is upgrading, mPageSizeCompatFlags in PackageSetting should be populated
        // according to the upgraded package.
        if (!createNewPackage) {
            pkgSetting.clearPageSizeAppCompatFlags();
        }

        if (Flags.appCompatOption16kb() && (is16KbDevice || enable4kbChecks)) {
            // Alignment checks are used decide whether this app should run in compat mode when
            // nothing was specified in manifest. Manifest should always take precedence over