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

Commit e1cb95bb authored by Nicolas Geoffray's avatar Nicolas Geoffray Committed by android-build-merger
Browse files

Merge "Use the new refined DexOptNeeded codes." am: d7e597a2 am: 99ae1848 am: 51b40ee3

am: fbeca51b

Change-Id: I7f6578d517a77dd24ab5dc785b7fdd0ab8fd5946
parents d0835e45 fbeca51b
Loading
Loading
Loading
Loading
+8 −7
Original line number Diff line number Diff line
@@ -219,19 +219,20 @@ class PackageDexOptimizer {

                final String dexoptType;
                String oatDir = null;
                switch (dexoptNeeded) {
                boolean isOdexLocation = (dexoptNeeded < 0);
                switch (Math.abs(dexoptNeeded)) {
                    case DexFile.NO_DEXOPT_NEEDED:
                        continue;
                    case DexFile.DEX2OAT_NEEDED:
                    case DexFile.DEX2OAT_FROM_SCRATCH:
                    case DexFile.DEX2OAT_FOR_BOOT_IMAGE:
                    case DexFile.DEX2OAT_FOR_FILTER:
                    case DexFile.DEX2OAT_FOR_RELOCATION:
                        dexoptType = "dex2oat";
                        oatDir = createOatDirIfSupported(pkg, dexCodeInstructionSet);
                        break;
                    case DexFile.PATCHOAT_NEEDED:
                    case DexFile.PATCHOAT_FOR_RELOCATION:
                        dexoptType = "patchoat";
                        break;
                    case DexFile.SELF_PATCHOAT_NEEDED:
                        dexoptType = "self patchoat";
                        break;
                    default:
                        throw new IllegalStateException("Invalid dexopt:" + dexoptNeeded);
                }
@@ -383,7 +384,7 @@ class PackageDexOptimizer {
        protected int adjustDexoptNeeded(int dexoptNeeded) {
            // Ensure compilation, no matter the current state.
            // TODO: The return value is wrong when patchoat is needed.
            return DexFile.DEX2OAT_NEEDED;
            return DexFile.DEX2OAT_FROM_SCRATCH;
        }
    }
}