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

Commit c94b2a70 authored by Vadim Tryshev's avatar Vadim Tryshev
Browse files

Add tracing for a bug where current RecentsActivity is null

Bug: 321775748
Test: presubmit
Flag: N/A
Change-Id: I46fde7a73a3bfe02ed6276b4ac5f3e6c33bda387
parent 1d6f76f8
Loading
Loading
Loading
Loading
+8 −2
Original line number Diff line number Diff line
@@ -15,13 +15,14 @@
 */
package com.android.launcher3.util;

import static com.android.launcher3.testing.shared.TestProtocol.GET_FROM_RECENTS_FAILURE;
import static com.android.launcher3.testing.shared.TestProtocol.testLogD;

import androidx.annotation.Nullable;

import com.android.launcher3.BaseActivity;

import java.lang.ref.WeakReference;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.concurrent.CopyOnWriteArrayList;

/**
@@ -40,6 +41,9 @@ public final class ActivityTracker<T extends BaseActivity> {

    public void onActivityDestroyed(T activity) {
        if (mCurrentActivity.get() == activity) {
            testLogD(GET_FROM_RECENTS_FAILURE,
                    String.format("ActivityTracker.onActivityDestroyed this=%s, activity=%s",
                            this, activity));
            mCurrentActivity.clear();
        }
    }
@@ -71,6 +75,8 @@ public final class ActivityTracker<T extends BaseActivity> {
    }

    public boolean handleCreate(T activity) {
        testLogD(GET_FROM_RECENTS_FAILURE,
                String.format("ActivityTracker.handleCreate this=%s, activity=%s", this, activity));
        mCurrentActivity = new WeakReference<>(activity);
        return handleIntent(activity, false /* alreadyOnHome */);
    }
+1 −0
Original line number Diff line number Diff line
@@ -172,6 +172,7 @@ public final class TestProtocol {
    public static final String OVERVIEW_OVER_HOME = "b/279059025";
    public static final String UIOBJECT_STALE_ELEMENT = "b/319501259";
    public static final String ACTIVITY_NOT_RESUMED_AFTER_BACK = "b/322823209";
    public static final String GET_FROM_RECENTS_FAILURE = "b/321775748";

    public static final String REQUEST_EMULATE_DISPLAY = "emulate-display";
    public static final String REQUEST_STOP_EMULATE_DISPLAY = "stop-emulate-display";