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

Commit 7f2b2461 authored by Songchun Fan's avatar Songchun Fan
Browse files

[pm] do not preserve abi override on update

Based on discussions in the bug, we will not preserve the previous value
of abi override during update installations.

Test: atest android.extractnativelibs.cts.CtsExtractNativeLibsHostTestAbiOverride
BUG: 163888243
Change-Id: Iac35ba3d6938f47b22b39cb307c91c0bcf228e0d
parent d6de4dcb
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -11587,7 +11587,7 @@ public class PackageManagerService extends IPackageManager.Stub
            configurePackageComponents(parsedPackage);
        }
        final String cpuAbiOverride = deriveAbiOverride(request.cpuAbiOverride, pkgSetting);
        final String cpuAbiOverride = deriveAbiOverride(request.cpuAbiOverride);
        final boolean isUpdatedSystemApp = pkgSetting.getPkgState().isUpdatedSystemApp();
        if ((scanFlags & SCAN_NEW_INSTALL) == 0) {
@@ -17620,7 +17620,7 @@ public class PackageManagerService extends IPackageManager.Stub
                }
                boolean isUpdatedSystemAppFromExistingSetting = pkgSetting != null
                        && pkgSetting.getPkgState().isUpdatedSystemApp();
                final String abiOverride = deriveAbiOverride(args.abiOverride, pkgSetting);
                final String abiOverride = deriveAbiOverride(args.abiOverride);
                AndroidPackage oldPackage = mPackages.get(pkgName);
                boolean isUpdatedSystemAppInferred = oldPackage != null && oldPackage.isSystem();
                final Pair<PackageAbiHelper.Abis, PackageAbiHelper.NativeLibraryPaths>
+4 −9
Original line number Diff line number Diff line
@@ -421,18 +421,13 @@ public class PackageManagerServiceUtils {

    /**
     * Derive the value of the {@code cpuAbiOverride} based on the provided
     * value and an optional stored value from the package settings.
     * value.
     */
    public static String deriveAbiOverride(String abiOverride, PackageSetting settings) {
        String cpuAbiOverride = null;
    public static String deriveAbiOverride(String abiOverride) {
        if (NativeLibraryHelper.CLEAR_ABI_OVERRIDE.equals(abiOverride)) {
            cpuAbiOverride = null;
        } else if (abiOverride != null) {
            cpuAbiOverride = abiOverride;
        } else if (settings != null) {
            cpuAbiOverride = settings.cpuAbiOverrideString;
            return null;
        }
        return cpuAbiOverride;
        return abiOverride;
    }

    /**