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

Commit dda79035 authored by Jiakai Zhang's avatar Jiakai Zhang
Browse files

Make PackageManager call into ART Service for incremental apps.

This will allow ART Service to verify and activate Cloud Compilation
artifacts for incremental apps on app install in the future.

This is a no-op at the moment, as ART Service will still skip dexopt
for incremental apps.

Bug: 377474232
Flag: EXEMPT refactor
Change-Id: I4846fd8c0a3f2a49349a5ebb08f2f6fa8dbdb621
Merged-In: I4846fd8c0a3f2a49349a5ebb08f2f6fa8dbdb621
(cherry picked from
https://googleplex-android-review.git.corp.google.com/c/platform/frameworks/base/+/31488478)

Change-Id: I3ed9137356d1a5ec1116bf0af271ab804bdb5da9
parent 5486787d
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -797,7 +797,8 @@ public final class DexOptHelper {
    private static boolean shouldSkipDexopt(InstallRequest installRequest) {
        PackageSetting ps = installRequest.getScannedPackageSetting();
        AndroidPackage pkg = ps.getPkg();
        return pkg == null || pkg.isDebuggable();
        boolean onIncremental = isIncrementalPath(ps.getPathString());
        return pkg == null || pkg.isDebuggable() || onIncremental;
    }

    /**
@@ -812,7 +813,6 @@ public final class DexOptHelper {
        final boolean instantApp = ((installRequest.getScanFlags() & SCAN_AS_INSTANT_APP) != 0);
        final PackageSetting ps = installRequest.getScannedPackageSetting();
        final AndroidPackage pkg = ps.getPkg();
        final boolean onIncremental = isIncrementalPath(ps.getPathString());
        final boolean performDexOptForRollback =
                !(installRequest.isRollback()
                        && installRequest
@@ -823,7 +823,7 @@ public final class DexOptHelper {
        // THINK TWICE when you add a new condition here. You probably want to add a condition to
        // `shouldSkipDexopt` instead. In that way, ART Service will be called with the "skip"
        // compiler filter and it will have the chance to decide whether to skip dexopt.
        return !instantApp && pkg != null && !onIncremental && !isApex && performDexOptForRollback;
        return !instantApp && pkg != null && !isApex && performDexOptForRollback;
    }

    private static class StagedApexObserver extends IStagedApexObserver.Stub {