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

Commit c4bef358 authored by Winson Chung's avatar Winson Chung Committed by Sunny Goyal
Browse files

DO NOT MERGE Revert "Defer recreation until resumed"

Bug: 171707437
Test: Repro steps in bug

This reverts commit 3f8d8681.

Change-Id: I909ab701c674fe975982a7de06dc9e89dcd03aea
(cherry picked from commit 272f4541)
parent e6769147
Loading
Loading
Loading
Loading
+1 −12
Original line number Diff line number Diff line
@@ -42,7 +42,6 @@ import android.widget.Toast;

import androidx.annotation.Nullable;

import com.android.launcher3.Launcher.OnResumeCallback;
import com.android.launcher3.LauncherSettings.Favorites;
import com.android.launcher3.logging.InstanceId;
import com.android.launcher3.logging.InstanceIdSequence;
@@ -108,20 +107,10 @@ public abstract class BaseDraggingActivity extends BaseActivity

    private void updateTheme() {
        if (mThemeRes != Themes.getActivityThemeRes(this)) {
            // Workaround (b/162812884): The system currently doesn't allow recreating an activity
            // when it is not resumed, in such a case defer recreation until it is possible
            if (hasBeenResumed()) {
            recreate();
            } else {
                addOnResumeCallback(this::recreate);
            }
        }
    }

    protected void addOnResumeCallback(OnResumeCallback callback) {
        // To be overridden
    }

    @Override
    public void onActionModeStarted(ActionMode mode) {
        super.onActionModeStarted(mode);
+0 −1
Original line number Diff line number Diff line
@@ -1977,7 +1977,6 @@ public class Launcher extends StatefulActivity<LauncherState> implements Launche
        return result;
    }

    @Override
    public void addOnResumeCallback(OnResumeCallback callback) {
        mOnResumeCallbacks.add(callback);
    }