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

Commit e3a1db43 authored by Jiakai Zhang's avatar Jiakai Zhang Committed by Cherrypicker Worker
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
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:de7c8c4e1bf26312f9973ede86b46091581e69b0)
Merged-In: I4846fd8c0a3f2a49349a5ebb08f2f6fa8dbdb621
Change-Id: I4846fd8c0a3f2a49349a5ebb08f2f6fa8dbdb621
parent c3fce7a0
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -851,7 +851,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;
    }

    /**
@@ -866,7 +867,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
@@ -877,7 +877,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 {