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

Commit 2a0cc2c3 authored by Martin Stjernholm's avatar Martin Stjernholm
Browse files

Skip rmdex when ART Service is in use.

There's no suitable API that can delete optimized artifacts relative to
an arbitrary APK path, so we'll rely on the ART Service file GC
instead. This means some regression as stale artifacts get deleted a
bit later than before.

Test: atest CtsCompilationTestCases
Bug: 251903639
Change-Id: Iae7ebbd891fbe58e40539ba34077320093e52924
parent a6194414
Loading
Loading
Loading
Loading
+12 −9
Original line number Diff line number Diff line
@@ -422,10 +422,12 @@ final class RemovePackageHelper {
            if (instructionSets == null) {
                throw new IllegalStateException("instructionSet == null");
            }
            // TODO(b/265813358): ART Service currently doesn't support deleting optimized artifacts
            // relative to an arbitrary APK path. Skip this and rely on its file GC instead.
            if (!DexOptHelper.useArtService()) {
                String[] dexCodeInstructionSets = getDexCodeInstructionSets(instructionSets);
                for (String codePath : allCodePaths) {
                    for (String dexCodeInstructionSet : dexCodeInstructionSets) {
                    // TODO(b/251903639): Call into ART Service.
                        try {
                            mPm.mInstaller.rmdex(codePath, dexCodeInstructionSet);
                        } catch (LegacyDexoptDisabledException e) {
@@ -436,6 +438,7 @@ final class RemovePackageHelper {
                }
            }
        }
    }

    void cleanUpForMoveInstall(String volumeUuid, String packageName, String fromCodePath) {
        final String toPathName = new File(fromCodePath).getName();