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

Commit daf37eeb authored by randypfohl's avatar randypfohl
Browse files

Cleaning up unusued handlers

Test: Built and tested locally

Flag: NONE Removing unused handler references

Bug:292269949

Change-Id: I83ec8299a82ea8f3db0dace7fb3b823a703b6b62
parent 7ed1868d
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -200,8 +200,6 @@ import com.android.systemui.unfold.progress.RemoteUnfoldTransitionReceiver;
import com.android.systemui.unfold.updates.RotationChangeProvider;
import com.android.wm.shell.shared.desktopmode.DesktopModeStatus;

import kotlin.Unit;

import java.io.FileDescriptor;
import java.io.PrintWriter;
import java.util.ArrayList;
@@ -214,6 +212,8 @@ import java.util.function.BiConsumer;
import java.util.function.Predicate;
import java.util.stream.Stream;

import kotlin.Unit;

public class QuickstepLauncher extends Launcher implements RecentsViewContainer,
        SystemShortcut.BubbleActivityStarter {
    private static final boolean TRACE_LAYOUTS =
@@ -271,7 +271,7 @@ public class QuickstepLauncher extends Launcher implements RecentsViewContainer,
        RecentsView<?,?> overviewPanel = getOverviewPanel();
        SystemUiProxy systemUiProxy = SystemUiProxy.INSTANCE.get(this);
        mSplitSelectStateController =
                new SplitSelectStateController(this, mHandler, getStateManager(),
                new SplitSelectStateController(this, getStateManager(),
                        getDepthController(), getStatsLogManager(),
                        systemUiProxy, RecentsModel.INSTANCE.get(this),
                        () -> onStateBack());
+1 −4
Original line number Diff line number Diff line
@@ -122,9 +122,6 @@ public final class RecentsActivity extends StatefulActivity<RecentsState> implem
    // Strong refs to runners which are cleared when the activity is destroyed
    private RemoteAnimationFactory mActivityLaunchAnimationRunner;

    // For handling degenerate cases where starting an activity doesn't actually trigger the remote
    // animation callback
    private final Handler mHandler = new Handler();
    private final Runnable mAnimationStartTimeoutRunnable = this::onAnimationStartTimeout;
    private SplitSelectStateController mSplitSelectStateController;
    @Nullable
@@ -137,7 +134,7 @@ public final class RecentsActivity extends StatefulActivity<RecentsState> implem
        SystemUiProxy systemUiProxy = SystemUiProxy.INSTANCE.get(this);
        // SplitSelectStateController needs to be created before setContentView()
        mSplitSelectStateController =
                new SplitSelectStateController(this, mHandler, getStateManager(),
                new SplitSelectStateController(this, getStateManager(),
                        null /* depthController */, getStatsLogManager(),
                        systemUiProxy, RecentsModel.INSTANCE.get(this),
                        null /*activityBackCallback*/);
+3 −8
Original line number Diff line number Diff line
@@ -22,7 +22,6 @@ import android.content.ComponentName
import android.content.Context
import android.content.LocusId
import android.os.Bundle
import android.os.Handler
import android.util.Log
import android.view.KeyEvent
import android.view.LayoutInflater
@@ -87,8 +86,7 @@ class RecentsWindowManager(context: Context) :

    protected var recentsView: FallbackRecentsView<RecentsWindowManager>? = null
    private val windowContext: Context = createWindowContext(TYPE_APPLICATION_OVERLAY, null)
    private val windowManager: WindowManager =
        windowContext.getSystemService(WindowManager::class.java)!!
    private val windowManager: WindowManager = windowContext.getSystemService(WindowManager::class.java)!!
    private var layoutInflater: LayoutInflater = LayoutInflater.from(this).cloneInContext(this)
    private var stateManager: StateManager<RecentsState, RecentsWindowManager> =
        StateManager<RecentsState, RecentsWindowManager>(this, RecentsState.BG_LAUNCHER)
@@ -98,8 +96,6 @@ class RecentsWindowManager(context: Context) :
    private var windowView: View? = null
    private var actionsView: OverviewActionsView<*>? = null
    private var scrimView: ScrimView? = null
    private val mHandler = Handler()


    private var isShown = false

@@ -201,9 +197,8 @@ class RecentsWindowManager(context: Context) :
        val splitSelectStateController =
            SplitSelectStateController(
                this,
                mHandler,
                getStateManager(),
                null /* depthController */,
                null, /* depthController */
                statsLogManager,
                systemUiProxy,
                RecentsModel.INSTANCE[this],
@@ -220,7 +215,7 @@ class RecentsWindowManager(context: Context) :
    }

    override fun canStartHomeSafely(): Boolean {
        val overviewCommandHelper = tisBindHelper!!.overviewCommandHelper
        val overviewCommandHelper = tisBindHelper.overviewCommandHelper
        return overviewCommandHelper == null || overviewCommandHelper.canStartHomeSafely()
    }

+1 −4
Original line number Diff line number Diff line
@@ -52,7 +52,6 @@ import android.graphics.Rect;
import android.graphics.RectF;
import android.graphics.drawable.Drawable;
import android.os.Bundle;
import android.os.Handler;
import android.os.IBinder;
import android.os.RemoteException;
import android.os.UserHandle;
@@ -116,7 +115,6 @@ public class SplitSelectStateController {
    private static final String TAG = "SplitSelectStateCtor";

    private RecentsViewContainer mContainer;
    private final Handler mHandler;
    private final RecentsModel mRecentTasksModel;
    @Nullable
    private Runnable mActivityBackCallback;
@@ -182,12 +180,11 @@ public class SplitSelectStateController {
        }
    };

    public SplitSelectStateController(RecentsViewContainer container, Handler handler,
    public SplitSelectStateController(RecentsViewContainer container,
            StateManager stateManager, DepthController depthController,
            StatsLogManager statsLogManager, SystemUiProxy systemUiProxy, RecentsModel recentsModel,
            Runnable activityBackCallback) {
        mContainer = container;
        mHandler = handler;
        mStatsLogManager = statsLogManager;
        mSystemUiProxy = systemUiProxy;
        mStateManager = stateManager;
+13 −4
Original line number Diff line number Diff line
@@ -73,10 +73,6 @@ public abstract class AbsSwipeUpHandlerTestCase<

    protected final Context mContext =
            InstrumentationRegistry.getInstrumentation().getTargetContext();
    protected final RecentsWindowManager mRecentsWindowManager =
            Flags.enableFallbackOverviewInWindow() ? new RecentsWindowManager(mContext) : null;
    protected final TaskAnimationManager mTaskAnimationManager =
            new TaskAnimationManager(mContext, mRecentsWindowManager);
    protected final RecentsAnimationDeviceState mRecentsAnimationDeviceState =
            new RecentsAnimationDeviceState(mContext, true);
    protected final InputConsumerController mInputConsumerController =
@@ -110,6 +106,9 @@ public abstract class AbsSwipeUpHandlerTestCase<
            /* minimizedHomeBounds= */ null,
            new Bundle());

    protected RecentsWindowManager mRecentsWindowManager;
    protected TaskAnimationManager mTaskAnimationManager;

    @Mock protected ACTIVITY_INTERFACE mActivityInterface;
    @Mock protected ActivityInitListener<?> mActivityInitListener;
    @Mock protected RecentsAnimationController mRecentsAnimationController;
@@ -123,6 +122,16 @@ public abstract class AbsSwipeUpHandlerTestCase<
    @Rule
    public final MockitoRule mMockitoRule = MockitoJUnit.rule();

    @Before
    public void setUpTaskAnimationManager() {
        runOnMainSync(() -> {
            if(Flags.enableFallbackOverviewInWindow()){
                mRecentsWindowManager = new RecentsWindowManager(mContext);
            }
            mTaskAnimationManager = new TaskAnimationManager(mContext, mRecentsWindowManager);
        });
    }

    @Before
    public void setUpRunningTaskInfo() {
        mRunningTaskInfo.baseIntent = new Intent(Intent.ACTION_MAIN)
Loading