Cleaning up unusued handlers
Test: Built and tested locally Flag: NONE Removing unused handler references Bug:292269949 Change-Id: I83ec8299a82ea8f3db0dace7fb3b823a703b6b62
This commit is contained in:
@@ -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());
|
||||
|
||||
@@ -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*/);
|
||||
|
||||
@@ -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()
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -22,7 +22,6 @@ import android.app.PendingIntent
|
||||
import android.content.ComponentName
|
||||
import android.content.Intent
|
||||
import android.graphics.Rect
|
||||
import android.os.Handler
|
||||
import android.os.UserHandle
|
||||
import androidx.test.ext.junit.runners.AndroidJUnit4
|
||||
import com.android.launcher3.LauncherState
|
||||
@@ -40,7 +39,6 @@ import com.android.quickstep.util.SplitSelectStateController.SplitFromDesktopCon
|
||||
import com.android.quickstep.views.RecentsViewContainer
|
||||
import com.android.systemui.shared.recents.model.Task
|
||||
import com.android.wm.shell.shared.split.SplitScreenConstants.SNAP_TO_50_50
|
||||
import java.util.function.Consumer
|
||||
import org.junit.Assert.assertEquals
|
||||
import org.junit.Assert.assertFalse
|
||||
import org.junit.Assert.assertNull
|
||||
@@ -54,6 +52,7 @@ import org.mockito.kotlin.argumentCaptor
|
||||
import org.mockito.kotlin.mock
|
||||
import org.mockito.kotlin.verify
|
||||
import org.mockito.kotlin.whenever
|
||||
import java.util.function.Consumer
|
||||
|
||||
@RunWith(AndroidJUnit4::class)
|
||||
class SplitSelectStateControllerTest {
|
||||
@@ -63,7 +62,6 @@ class SplitSelectStateControllerTest {
|
||||
private val statsLogManager: StatsLogManager = mock()
|
||||
private val statsLogger: StatsLogger = mock()
|
||||
private val stateManager: StateManager<LauncherState, StatefulActivity<LauncherState>> = mock()
|
||||
private val handler: Handler = mock()
|
||||
private val context: RecentsViewContainer = mock()
|
||||
private val recentsModel: RecentsModel = mock()
|
||||
private val pendingIntent: PendingIntent = mock()
|
||||
@@ -87,7 +85,6 @@ class SplitSelectStateControllerTest {
|
||||
splitSelectStateController =
|
||||
SplitSelectStateController(
|
||||
context,
|
||||
handler,
|
||||
stateManager,
|
||||
depthController,
|
||||
statsLogManager,
|
||||
|
||||
Reference in New Issue
Block a user