Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6b3d3b38 authored by Alex Light's avatar Alex Light
Browse files

Don't try to report non-existent stats

During OTAPreopt we don't have compilation stats due to the way we
compile things. Don't attempt to report stats in this case since it
will cause an NPE.

Test: manual OTA on a blueline
Bug: 181182967
Bug: 177694884
Change-Id: Ie2eb4d7e2ab562d4436a605bcbdd2ea17517dfc3
Merged-In: Ie2eb4d7e2ab562d4436a605bcbdd2ea17517dfc3
parent d880cf50
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -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();