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

Commit 0d511e90 authored by Martin Stjernholm's avatar Martin Stjernholm
Browse files

Remove the "android" package from dexopting.

We no longer allow dexopting the system server, so we need to ensure it
isn't added to the list of packages to dexopt.

Test: adb shell pm compile -m speed-profile -f -a
  with dalvik.vm.useartservice=false
Bug: 274576247
Change-Id: I9da100987e611e59ac6ef2282bf0221d9417bc9a
parent 9d56ebbc
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -745,6 +745,9 @@ public final class DexOptHelper {
        applyPackageFilter(snapshot, remainingPredicate, result, remainingPkgSettings, sortTemp,
                packageManagerService);

        // Make sure the system server isn't in the result, because it can never be dexopted here.
        result.removeIf(pkgSetting -> PLATFORM_PACKAGE_NAME.equals(pkgSetting.getPackageName()));

        if (debug) {
            Log.i(TAG, "Packages to be dexopted: " + packagesToString(result));
            Log.i(TAG, "Packages skipped from dexopt: " + packagesToString(remainingPkgSettings));
+3 −0
Original line number Diff line number Diff line
@@ -24,6 +24,7 @@ import static android.content.pm.PackageManager.FLAG_PERMISSION_USER_FIXED;
import static android.content.pm.PackageManager.FLAG_PERMISSION_USER_SET;

import static com.android.server.LocalManagerRegistry.ManagerNotFoundException;
import static com.android.server.pm.PackageManagerService.PLATFORM_PACKAGE_NAME;

import android.accounts.IAccountManager;
import android.annotation.NonNull;
@@ -1950,6 +1951,8 @@ class PackageManagerShellCommand extends ShellCommand {
        List<String> packageNames = null;
        if (allPackages) {
            packageNames = mInterface.getAllPackages();
            // Compiling the system server is only supported from odrefresh, so skip it.
            packageNames.removeIf(packageName -> PLATFORM_PACKAGE_NAME.equals(packageName));
        } else {
            String packageName = getNextArg();
            if (packageName == null) {