summaryrefslogtreecommitdiff
path: root/services/core
diff options
context:
space:
mode:
authorYan Wang <yawanng@google.com>2021-03-19 16:55:54 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2021-03-19 16:55:54 +0000
commit08d538076290628d9be5a9196e5a752beba12498 (patch)
tree5e8a5224e7e379d78d73fb99c8637325b24a130e /services/core
parentcd37173df6570293a4ef9d072e42eca1f08d1d7f (diff)
parent5bbfca3f1eadc30f78bff579de184d16251c7d86 (diff)
Merge "Remove the reading of APK file."
Diffstat (limited to 'services/core')
-rw-r--r--services/core/java/com/android/server/pm/dex/ArtStatsLogUtils.java36
1 files changed, 0 insertions, 36 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;