Merge "Don't try to report non-existent stats" am: 8c9b5df98a

Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1649153

Change-Id: Id29d2368b9ee734b870134edcfa65b517d05a801
This commit is contained in:
Treehugger Robot
2021-03-24 16:43:28 +00:00
committed by Automerger Merge Worker

View File

@@ -51,8 +51,8 @@ import android.os.FileUtils;
import android.os.PowerManager;
import android.os.SystemClock;
import android.os.SystemProperties;
import android.os.UserHandle;
import android.os.Trace;
import android.os.UserHandle;
import android.os.WorkSource;
import android.os.storage.StorageManager;
import android.util.Log;
@@ -260,7 +260,8 @@ public class PackageDexOptimizer {
// Only report metrics for base apk for now.
// TODO: add ISA and APK type to metrics.
if (pkg.getBaseCodePath().equals(path)) {
// OTAPreopt doesn't have stats so don't report in that case.
if (pkg.getBaseCodePath().equals(path) && packageStats != null) {
Trace.traceBegin(Trace.TRACE_TAG_PACKAGE_MANAGER, "dex2oat-metrics");
try {
long sessionId = Math.randomLongInternal();