From c041c33c029df0bf4f19638dec6634d4c1c310c9 Mon Sep 17 00:00:00 2001 From: Andreas Gampe Date: Wed, 1 Nov 2017 17:05:53 -0700 Subject: Frameworks: Fix idle-background-job flag Correctly pass flag to installd. Bug: 68025088 Test: m Test: manual test Change-Id: Ia5b19b1f1375a3c8b0c8e19b1978dcba29c83470 --- .../java/com/android/server/pm/PackageDexOptimizer.java | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/services/core/java/com/android/server/pm/PackageDexOptimizer.java b/services/core/java/com/android/server/pm/PackageDexOptimizer.java index dfa828df5236..50f85ea00a2c 100644 --- a/services/core/java/com/android/server/pm/PackageDexOptimizer.java +++ b/services/core/java/com/android/server/pm/PackageDexOptimizer.java @@ -187,7 +187,7 @@ public class PackageDexOptimizer { // Get the dexopt flags after getRealCompilerFilter to make sure we get the correct // flags. - final int dexoptFlags = getDexFlags(pkg, compilerFilter, options.isBootComplete()); + final int dexoptFlags = getDexFlags(pkg, compilerFilter, options); for (String dexCodeIsa : dexCodeInstructionSets) { int newResult = dexOptPath(pkg, path, dexCodeIsa, compilerFilter, @@ -327,8 +327,7 @@ public class PackageDexOptimizer { dexUseInfo.isUsedByOtherApps()); // Get the dexopt flags after getRealCompilerFilter to make sure we get the correct flags. // Secondary dex files are currently not compiled at boot. - int dexoptFlags = getDexFlags(info, compilerFilter, /* bootComplete */ true) - | DEXOPT_SECONDARY_DEX; + int dexoptFlags = getDexFlags(info, compilerFilter, options) | DEXOPT_SECONDARY_DEX; // Check the app storage and add the appropriate flags. if (info.deviceProtectedDataDir != null && FileUtils.contains(info.deviceProtectedDataDir, path)) { @@ -477,11 +476,11 @@ public class PackageDexOptimizer { * filter. */ private int getDexFlags(PackageParser.Package pkg, String compilerFilter, - boolean bootComplete) { - return getDexFlags(pkg.applicationInfo, compilerFilter, bootComplete); + DexoptOptions options) { + return getDexFlags(pkg.applicationInfo, compilerFilter, options); } - private int getDexFlags(ApplicationInfo info, String compilerFilter, boolean bootComplete) { + private int getDexFlags(ApplicationInfo info, String compilerFilter, DexoptOptions options) { int flags = info.flags; boolean debuggable = (flags & ApplicationInfo.FLAG_DEBUGGABLE) != 0; // Profile guide compiled oat files should not be public. @@ -492,7 +491,8 @@ public class PackageDexOptimizer { (isPublic ? DEXOPT_PUBLIC : 0) | (debuggable ? DEXOPT_DEBUGGABLE : 0) | profileFlag - | (bootComplete ? DEXOPT_BOOTCOMPLETE : 0); + | (options.isBootComplete() ? DEXOPT_BOOTCOMPLETE : 0) + | (options.isDexoptIdleBackgroundJob() ? DEXOPT_IDLE_BACKGROUND_JOB : 0); return adjustDexoptFlags(dexFlags); } -- cgit v1.2.3-59-g8ed1b