diff options
author | Calin Juravle <calin@google.com> | 2018-03-30 12:38:59 -0700 |
---|---|---|
committer | Calin Juravle <calin@google.com> | 2018-03-30 14:04:48 -0700 |
commit | 7fc0f633bc11c9fd89eb4bd3581ea2e85eaa31c1 (patch) | |
tree | fc7f0c129e5e5ea67c8c8417c87d2e0897fa7ce0 | |
parent | d9b53a097d0eec2d1112b25a67b28c203e9251f9 (diff) |
Fix BackgroundDexOptTest
Test: atest BackgroundDexOptServiceIntegrationTests
Bug: 76425903
Change-Id: I19b72b95ee19ebe1807e1ce108a39dec6196a097
3 files changed, 8 insertions, 9 deletions
diff --git a/services/core/java/com/android/server/pm/PackageDexOptimizer.java b/services/core/java/com/android/server/pm/PackageDexOptimizer.java index 98073429faab..892fa12ddf52 100644 --- a/services/core/java/com/android/server/pm/PackageDexOptimizer.java +++ b/services/core/java/com/android/server/pm/PackageDexOptimizer.java @@ -450,11 +450,9 @@ public class PackageDexOptimizer { for (String isa : dexCodeInstructionSets) { try { - String[] status = DexFile.getDexFileOptimizationStatus(path, isa); - String compilationStatus = status[0]; - String compilationReason = status[1]; - pw.println(isa + ": [status=" + compilationStatus - +"] reason=[" + compilationReason + "]"); + DexFile.OptimizationInfo info = DexFile.getDexFileOptimizationInfo(path, isa); + pw.println(isa + ": [status=" + info.getStatus() + +"] [reason=" + info.getReason() + "]"); } catch (IOException ioe) { pw.println(isa + ": [Exception]: " + ioe.getMessage()); } diff --git a/services/core/java/com/android/server/pm/dex/ArtManagerService.java b/services/core/java/com/android/server/pm/dex/ArtManagerService.java index cdafe5715ffc..9c2ad4635d58 100644 --- a/services/core/java/com/android/server/pm/dex/ArtManagerService.java +++ b/services/core/java/com/android/server/pm/dex/ArtManagerService.java @@ -527,9 +527,10 @@ public class ArtManagerService extends android.content.pm.dex.IArtManager.Stub { String compilationFilter; try { String isa = VMRuntime.getInstructionSet(abi); - String[] stats = DexFile.getDexFileOptimizationStatus(info.getBaseCodePath(), isa); - compilationFilter = stats[0]; - compilationReason = stats[1]; + DexFile.OptimizationInfo optInfo = + DexFile.getDexFileOptimizationInfo(info.getBaseCodePath(), isa); + compilationFilter = optInfo.getStatus(); + compilationReason = optInfo.getReason(); } catch (FileNotFoundException e) { Slog.e(TAG, "Could not get optimizations status for " + info.getBaseCodePath(), e); compilationFilter = "error"; diff --git a/tests/BackgroundDexOptServiceIntegrationTests/src/com/android/server/pm/BackgroundDexOptServiceIntegrationTests.java b/tests/BackgroundDexOptServiceIntegrationTests/src/com/android/server/pm/BackgroundDexOptServiceIntegrationTests.java index 3734412981d8..e247951f16ef 100644 --- a/tests/BackgroundDexOptServiceIntegrationTests/src/com/android/server/pm/BackgroundDexOptServiceIntegrationTests.java +++ b/tests/BackgroundDexOptServiceIntegrationTests/src/com/android/server/pm/BackgroundDexOptServiceIntegrationTests.java @@ -173,7 +173,7 @@ public final class BackgroundDexOptServiceIntegrationTests { private static String getCompilerFilter(String pkg) throws IOException { String cmd = String.format("dumpsys package %s", pkg); String[] lines = runShellCommandSplitLines(cmd); - final String substr = "compilation_filter="; + final String substr = "[status="; for (String line : lines) { int startIndex = line.indexOf(substr); if (startIndex < 0) { |