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

Commit 6ce213fe authored by Calin Juravle's avatar Calin Juravle
Browse files

Update DexFile.getDexOptNeeded in framework

Partial cherry pick from commit 693f997c

Change-Id: I0fe34541e3cf77fb6e6dbe689b7cf55cb78dbe05
parent 9036a978
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -484,7 +484,7 @@ public class ZygoteInit {
        try {
        try {
            for (String classPathElement : classPathElements) {
            for (String classPathElement : classPathElements) {
                final int dexoptNeeded = DexFile.getDexOptNeeded(
                final int dexoptNeeded = DexFile.getDexOptNeeded(
                        classPathElement, "*", instructionSet, false /* defer */);
                        classPathElement, instructionSet, DexFile.COMPILATION_TYPE_FULL);
                if (dexoptNeeded != DexFile.NO_DEXOPT_NEEDED) {
                if (dexoptNeeded != DexFile.NO_DEXOPT_NEEDED) {
                    installer.dexopt(classPathElement, Process.SYSTEM_UID, instructionSet,
                    installer.dexopt(classPathElement, Process.SYSTEM_UID, instructionSet,
                            dexoptNeeded, 0 /*dexFlags*/);
                            dexoptNeeded, 0 /*dexFlags*/);
+2 −2
Original line number Original line Diff line number Diff line
@@ -145,8 +145,8 @@ final class PackageDexOptimizer {
                    dexoptNeeded = DexFile.DEX2OAT_NEEDED;
                    dexoptNeeded = DexFile.DEX2OAT_NEEDED;
                } else {
                } else {
                    try {
                    try {
                        dexoptNeeded = DexFile.getDexOptNeeded(path, pkg.packageName,
                        dexoptNeeded = DexFile.getDexOptNeeded(path,
                                dexCodeInstructionSet, defer);
                                dexCodeInstructionSet, DexFile.COMPILATION_TYPE_FULL);
                    } catch (IOException ioe) {
                    } catch (IOException ioe) {
                        Slog.w(TAG, "IOException reading apk: " + path, ioe);
                        Slog.w(TAG, "IOException reading apk: " + path, ioe);
                        return DEX_OPT_FAILED;
                        return DEX_OPT_FAILED;
+4 −2
Original line number Original line Diff line number Diff line
@@ -1978,7 +1978,8 @@ public class PackageManagerService extends IPackageManager.Stub {
                        }
                        }
                        try {
                        try {
                            int dexoptNeeded = DexFile.getDexOptNeeded(lib, null, dexCodeInstructionSet, false);
                            int dexoptNeeded = DexFile.getDexOptNeeded(lib, dexCodeInstructionSet,
                                    DexFile.COMPILATION_TYPE_FULL);
                            if (dexoptNeeded != DexFile.NO_DEXOPT_NEEDED) {
                            if (dexoptNeeded != DexFile.NO_DEXOPT_NEEDED) {
                                alreadyDexOpted.add(lib);
                                alreadyDexOpted.add(lib);
                                mInstaller.dexopt(lib, Process.SYSTEM_UID, dexCodeInstructionSet,
                                mInstaller.dexopt(lib, Process.SYSTEM_UID, dexCodeInstructionSet,
@@ -2028,7 +2029,8 @@ public class PackageManagerService extends IPackageManager.Stub {
                            continue;
                            continue;
                        }
                        }
                        try {
                        try {
                            int dexoptNeeded = DexFile.getDexOptNeeded(path, null, dexCodeInstructionSet, false);
                            int dexoptNeeded = DexFile.getDexOptNeeded(path, dexCodeInstructionSet,
                                    DexFile.COMPILATION_TYPE_FULL);
                            if (dexoptNeeded != DexFile.NO_DEXOPT_NEEDED) {
                            if (dexoptNeeded != DexFile.NO_DEXOPT_NEEDED) {
                                mInstaller.dexopt(path, Process.SYSTEM_UID, dexCodeInstructionSet,
                                mInstaller.dexopt(path, Process.SYSTEM_UID, dexCodeInstructionSet,
                                        dexoptNeeded, DEXOPT_PUBLIC /*dexFlags*/);
                                        dexoptNeeded, DEXOPT_PUBLIC /*dexFlags*/);