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

Commit a62534b9 authored by Vishnu Nair's avatar Vishnu Nair
Browse files

AM: Fix NPE in AML when we cannot find launch info associated to a transition

Change-Id: I29677347b0c42bdd94526532ee83ad5e79cc62d1
Fixes: b/119284973
Test: atest ActivityMetricsLogger
parent 8e3554a1
Loading
Loading
Loading
Loading
+6 −4
Original line number Diff line number Diff line
@@ -72,12 +72,12 @@ import static com.android.internal.logging.nano.MetricsProto.MetricsEvent.TYPE_T
import static com.android.internal.logging.nano.MetricsProto.MetricsEvent.TYPE_TRANSITION_REPORTED_DRAWN_NO_BUNDLE;
import static com.android.internal.logging.nano.MetricsProto.MetricsEvent.TYPE_TRANSITION_REPORTED_DRAWN_WITH_BUNDLE;
import static com.android.internal.logging.nano.MetricsProto.MetricsEvent.TYPE_TRANSITION_WARM_LAUNCH;
import static com.android.server.wm.ActivityTaskManagerDebugConfig.DEBUG_METRICS;
import static com.android.server.wm.ActivityTaskManagerDebugConfig.TAG_ATM;
import static com.android.server.wm.ActivityTaskManagerDebugConfig.TAG_WITH_CLASS_NAME;
import static com.android.server.am.EventLogTags.AM_ACTIVITY_LAUNCH_TIME;
import static com.android.server.am.MemoryStatUtil.MemoryStat;
import static com.android.server.am.MemoryStatUtil.readMemoryStatFromFilesystem;
import static com.android.server.wm.ActivityTaskManagerDebugConfig.DEBUG_METRICS;
import static com.android.server.wm.ActivityTaskManagerDebugConfig.TAG_ATM;
import static com.android.server.wm.ActivityTaskManagerDebugConfig.TAG_WITH_CLASS_NAME;
import static com.android.server.wm.ActivityTaskManagerInternal.APP_TRANSITION_TIMEOUT;

import android.app.WindowConfiguration.WindowingMode;
@@ -495,7 +495,9 @@ class ActivityMetricsLogger {
            foundInfo = info;
        }
        if (allWindowsDrawn()) {
            reset(false /* abort */, foundInfo, "notifyTransitionStarting - all windows drawn");
            // abort metrics collection if we cannot find a matching transition.
            final boolean abortMetrics = foundInfo == null;
            reset(abortMetrics, foundInfo, "notifyTransitionStarting - all windows drawn");
        }
    }