Fix BackgroundDexOptTest
Test: atest BackgroundDexOptServiceIntegrationTests Bug: 76425903 Change-Id: I19b72b95ee19ebe1807e1ce108a39dec6196a097
This commit is contained in:
@@ -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());
|
||||
}
|
||||
|
||||
@@ -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";
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user