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

Commit 0b32b7a9 authored by Vadim Tryshev's avatar Vadim Tryshev Committed by Android (Google) Code Review
Browse files

Merge "Add tracing for a bug where current RecentsActivity is null" into main

parents c93dc0e5 c94b2a70
Loading
Loading
Loading
Loading
+8 −2
Original line number Original line Diff line number Diff line
@@ -15,13 +15,14 @@
 */
 */
package com.android.launcher3.util;
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 androidx.annotation.Nullable;


import com.android.launcher3.BaseActivity;
import com.android.launcher3.BaseActivity;


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


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


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


    public boolean handleCreate(T activity) {
    public boolean handleCreate(T activity) {
        testLogD(GET_FROM_RECENTS_FAILURE,
                String.format("ActivityTracker.handleCreate this=%s, activity=%s", this, activity));
        mCurrentActivity = new WeakReference<>(activity);
        mCurrentActivity = new WeakReference<>(activity);
        return handleIntent(activity, false /* alreadyOnHome */);
        return handleIntent(activity, false /* alreadyOnHome */);
    }
    }
+1 −0
Original line number Original line 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 OVERVIEW_OVER_HOME = "b/279059025";
    public static final String UIOBJECT_STALE_ELEMENT = "b/319501259";
    public static final String UIOBJECT_STALE_ELEMENT = "b/319501259";
    public static final String ACTIVITY_NOT_RESUMED_AFTER_BACK = "b/322823209";
    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_EMULATE_DISPLAY = "emulate-display";
    public static final String REQUEST_STOP_EMULATE_DISPLAY = "stop-emulate-display";
    public static final String REQUEST_STOP_EMULATE_DISPLAY = "stop-emulate-display";