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

Commit 33e1b74e authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Add CPU ABI fallback directly into PackageState"

parents 4b24b64f c87545bf
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -298,7 +298,8 @@ final class AppDataHelper {
            // Create a native library symlink only if we have native libraries
            // and if the native libraries are 32 bit libraries. We do not provide
            // this symlink for 64 bit libraries.
            String primaryCpuAbi = AndroidPackageUtils.getPrimaryCpuAbi(pkg, pkgSetting);
            String primaryCpuAbi = pkgSetting == null
                    ? AndroidPackageUtils.getRawPrimaryCpuAbi(pkg) : pkgSetting.getPrimaryCpuAbi();
            if (primaryCpuAbi != null && !VMRuntime.is64BitAbi(primaryCpuAbi)) {
                final String nativeLibPath = pkg.getNativeLibraryDir();
                if (!(new File(nativeLibPath).exists())) {
+2 −2
Original line number Diff line number Diff line
@@ -1674,8 +1674,8 @@ public class ComputerEngine implements Computer {
            ApplicationInfo ai = new ApplicationInfo();
            ai.packageName = ps.getPackageName();
            ai.uid = UserHandle.getUid(userId, ps.getAppId());
            ai.primaryCpuAbi = ps.getPrimaryCpuAbi();
            ai.secondaryCpuAbi = ps.getSecondaryCpuAbi();
            ai.primaryCpuAbi = ps.getPrimaryCpuAbiLegacy();
            ai.secondaryCpuAbi = ps.getSecondaryCpuAbiLegacy();
            ai.setVersionCode(ps.getVersionCode());
            ai.flags = ps.getFlags();
            ai.privateFlags = ps.getPrivateFlags();
+1 −1
Original line number Diff line number Diff line
@@ -573,7 +573,7 @@ final class DeletePackageHelper {
        if (deleteCodeAndResources && (outInfo != null)) {
            outInfo.mArgs = new InstallArgs(
                    ps.getPathString(), getAppDexInstructionSets(
                            ps.getPrimaryCpuAbi(), ps.getSecondaryCpuAbi()));
                            ps.getPrimaryCpuAbiLegacy(), ps.getSecondaryCpuAbiLegacy()));
            if (DEBUG_SD_INSTALL) Slog.i(TAG, "args=" + outInfo.mArgs);
        }
    }
+2 −3
Original line number Diff line number Diff line
@@ -58,7 +58,6 @@ import com.android.internal.annotations.GuardedBy;
import com.android.internal.logging.MetricsLogger;
import com.android.server.pm.dex.DexManager;
import com.android.server.pm.dex.DexoptOptions;
import com.android.server.pm.parsing.pkg.AndroidPackageUtils;
import com.android.server.pm.pkg.AndroidPackage;
import com.android.server.pm.pkg.PackageStateInternal;

@@ -470,8 +469,8 @@ final class DexOptHelper {
        // others will see that the compiled code for the library is up to date.
        Collection<SharedLibraryInfo> deps = SharedLibraryUtils.findSharedLibraries(pkgSetting);
        final String[] instructionSets = getAppDexInstructionSets(
                AndroidPackageUtils.getPrimaryCpuAbi(p, pkgSetting),
                AndroidPackageUtils.getSecondaryCpuAbi(p, pkgSetting));
                pkgSetting.getPrimaryCpuAbi(),
                pkgSetting.getSecondaryCpuAbi());
        if (!deps.isEmpty()) {
            DexoptOptions libraryOptions = new DexoptOptions(options.getPackageName(),
                    options.getCompilationReason(), options.getCompilerFilter(),
+7 −9
Original line number Diff line number Diff line
@@ -1377,8 +1377,8 @@ final class InstallPackageHelper {

                // We moved the entire application as-is, so bring over the
                // previously derived ABI information.
                parsedPackage.setPrimaryCpuAbi(ps.getPrimaryCpuAbi())
                        .setSecondaryCpuAbi(ps.getSecondaryCpuAbi());
                parsedPackage.setPrimaryCpuAbi(ps.getPrimaryCpuAbiLegacy())
                        .setSecondaryCpuAbi(ps.getSecondaryCpuAbiLegacy());
            }

        } else {
@@ -1932,10 +1932,8 @@ final class InstallPackageHelper {
                        installRequest.getRemovedInfo().mArgs = new InstallArgs(
                                oldPackage.getPath(),
                                getAppDexInstructionSets(
                                        AndroidPackageUtils.getPrimaryCpuAbi(oldPackage,
                                                deletedPkgSetting),
                                        AndroidPackageUtils.getSecondaryCpuAbi(oldPackage,
                                                deletedPkgSetting)));
                                        deletedPkgSetting.getPrimaryCpuAbi(),
                                        deletedPkgSetting.getSecondaryCpuAbi()));
                    } else {
                        installRequest.getRemovedInfo().mArgs = null;
                    }
@@ -3944,8 +3942,8 @@ final class InstallPackageHelper {

            mRemovePackageHelper.cleanUpResources(
                    new File(pkgSetting.getPathString()),
                    getAppDexInstructionSets(pkgSetting.getPrimaryCpuAbi(),
                            pkgSetting.getSecondaryCpuAbi()));
                    getAppDexInstructionSets(pkgSetting.getPrimaryCpuAbiLegacy(),
                            pkgSetting.getSecondaryCpuAbiLegacy()));
            synchronized (mPm.mLock) {
                mPm.mSettings.enableSystemPackageLPw(pkgSetting.getPackageName());
            }
@@ -4029,7 +4027,7 @@ final class InstallPackageHelper {
                                + parsedPackage.getPath());
                mRemovePackageHelper.cleanUpResources(new File(pkgSetting.getPathString()),
                        getAppDexInstructionSets(
                                pkgSetting.getPrimaryCpuAbi(), pkgSetting.getSecondaryCpuAbi()));
                                pkgSetting.getPrimaryCpuAbiLegacy(), pkgSetting.getSecondaryCpuAbiLegacy()));
            } else {
                // The application on /system is older than the application on /data. Hide
                // the application on /system and the version on /data will be scanned later
Loading