diff options
Diffstat (limited to 'services')
-rw-r--r-- | services/core/java/com/android/server/pm/dex/ArtStatsLogUtils.java | 36 | ||||
-rw-r--r-- | services/tests/servicestests/src/com/android/server/pm/dex/ArtStatsLogUtilsTest.java | 8 |
2 files changed, 0 insertions, 44 deletions
diff --git a/services/core/java/com/android/server/pm/dex/ArtStatsLogUtils.java b/services/core/java/com/android/server/pm/dex/ArtStatsLogUtils.java index 0c8e36b75425..c8dc1b1ff562 100644 --- a/services/core/java/com/android/server/pm/dex/ArtStatsLogUtils.java +++ b/services/core/java/com/android/server/pm/dex/ArtStatsLogUtils.java @@ -146,47 +146,11 @@ public class ArtStatsLogUtils { uid, compilationReason, compilerFilter, - ArtStatsLog.ART_DATUM_REPORTED__KIND__ART_DATUM_DEX2OAT_DEX_CODE_BYTES, - getDexBytes(path), - dexMetadataType); - logger.write( - sessionId, - uid, - compilationReason, - compilerFilter, ArtStatsLog.ART_DATUM_REPORTED__KIND__ART_DATUM_DEX2OAT_TOTAL_TIME, compileTime, dexMetadataType); } - private static long getDexBytes(String apkPath) { - StrictJarFile jarFile = null; - long dexBytes = 0; - try { - jarFile = new StrictJarFile(apkPath, - /*verify=*/ false, - /*signatureSchemeRollbackProtectionsEnforced=*/ false); - Iterator<ZipEntry> it = jarFile.iterator(); - while (it.hasNext()) { - ZipEntry entry = it.next(); - if (entry.getName().matches("classes(\\d)*[.]dex")) { - dexBytes += entry.getSize(); - } - } - return dexBytes; - } catch (IOException ignore) { - Slog.e(TAG, "Error when parsing APK " + apkPath); - return -1L; - } finally { - try { - if (jarFile != null) { - jarFile.close(); - } - } catch (IOException ignore) { - } - } - } - private static int getDexMetadataType(String dexMetadataPath) { if (dexMetadataPath == null) { return ArtStatsLog.ART_DATUM_REPORTED__DEX_METADATA_TYPE__ART_DEX_METADATA_TYPE_NONE; diff --git a/services/tests/servicestests/src/com/android/server/pm/dex/ArtStatsLogUtilsTest.java b/services/tests/servicestests/src/com/android/server/pm/dex/ArtStatsLogUtilsTest.java index e605d755183f..13d75a77507f 100644 --- a/services/tests/servicestests/src/com/android/server/pm/dex/ArtStatsLogUtilsTest.java +++ b/services/tests/servicestests/src/com/android/server/pm/dex/ArtStatsLogUtilsTest.java @@ -245,14 +245,6 @@ public final class ArtStatsLogUtilsTest { UID, COMPILATION_REASON, COMPILER_FILTER, - ArtStatsLog.ART_DATUM_REPORTED__KIND__ART_DATUM_DEX2OAT_DEX_CODE_BYTES, - DEX_CONTENT.length, - dexMetadataType); - inorder.verify(mockLogger).write( - SESSION_ID, - UID, - COMPILATION_REASON, - COMPILER_FILTER, ArtStatsLog.ART_DATUM_REPORTED__KIND__ART_DATUM_DEX2OAT_TOTAL_TIME, COMPILE_TIME, dexMetadataType); |