diff --git a/quickstep/src/com/android/quickstep/fallback/FallbackRecentsView.java b/quickstep/src/com/android/quickstep/fallback/FallbackRecentsView.java index a2c2f0b19f..5b98d07e81 100644 --- a/quickstep/src/com/android/quickstep/fallback/FallbackRecentsView.java +++ b/quickstep/src/com/android/quickstep/fallback/FallbackRecentsView.java @@ -92,6 +92,10 @@ public class FallbackRecentsView?>(R.id.overview_panel) + ?.apply { + init( + actionsView, + SplitSelectStateController( + /* container= */ this@RecentsWindowManager, + stateManager, + /* depthController= */ null, + statsLogManager, + SystemUiProxy.INSTANCE[this@RecentsWindowManager], + RecentsModel.INSTANCE[this@RecentsWindowManager], + /* activityBackCallback= */ null, + ), + /* desktopRecentsTransitionController= */ null, + ) + } + actionsView?.apply { + updateDimension(getDeviceProfile(), recentsView?.lastComputedTaskSize) + updateVerticalMargin(DisplayController.getNavigationMode(this@RecentsWindowManager)) + } + scrimView = it.findViewById(R.id.scrim_view) + dragLayer = it.findViewById(R.id.drag_layer) - windowView?.systemUiVisibility = - (View.SYSTEM_UI_FLAG_LAYOUT_STABLE or - View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN or - View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION) + it.findOnBackInvokedDispatcher() + ?.registerSystemOnBackInvokedCallback(onBackInvokedCallback) - recentsView = windowView?.findViewById(R.id.overview_panel) - actionsView = windowView?.findViewById(R.id.overview_actions_view) - scrimView = windowView?.findViewById(R.id.scrim_view) - val systemUiProxy = SystemUiProxy.INSTANCE[this] - val splitSelectStateController = - SplitSelectStateController( - this, - getStateManager(), - null, /* depthController */ - statsLogManager, - systemUiProxy, - RecentsModel.INSTANCE[this], - null, /*activityBackCallback*/ - ) - recentsView?.init(actionsView, splitSelectStateController, null) - dragLayer = windowView?.findViewById(R.id.drag_layer) - - actionsView?.updateDimension(getDeviceProfile(), recentsView?.lastComputedTaskSize) - actionsView?.updateVerticalMargin(DisplayController.getNavigationMode(this)) + it.systemUiVisibility = + (View.SYSTEM_UI_FLAG_LAYOUT_STABLE or + View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN or + View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION) + } systemUiController = SystemUiController(windowView) recentsWindowTracker.handleCreate(this) diff --git a/quickstep/src/com/android/quickstep/views/RecentsView.java b/quickstep/src/com/android/quickstep/views/RecentsView.java index 5168cc7316..ace1f13907 100644 --- a/quickstep/src/com/android/quickstep/views/RecentsView.java +++ b/quickstep/src/com/android/quickstep/views/RecentsView.java @@ -2760,7 +2760,9 @@ public abstract class RecentsView< mBlurUtils.setDrawLiveTileBelowRecents(false); // These are relatively expensive and don't need to be done this frame (RecentsView isn't // visible anyway), so defer by a frame to get off the critical path, e.g. app to home. - post(this::onReset); + // Defer onto the main thread rather than the view message queue since this will not always + // be called in the Recents In Window case. + MAIN_EXECUTOR.getHandler().post(this::onReset); } private void onReset() {