Merge "Prevent tap in swipe up zone from closing KQS" into main
This commit is contained in:
committed by
Android (Google) Code Review
commit
5e77702197
@@ -70,6 +70,8 @@ public class KeyboardQuickSwitchViewController {
|
||||
private boolean mOnDesktop;
|
||||
private boolean mWasDesktopTaskFilteredOut;
|
||||
|
||||
private boolean mDetachingFromWindow = false;
|
||||
|
||||
protected KeyboardQuickSwitchViewController(
|
||||
@NonNull TaskbarControllers controllers,
|
||||
@NonNull TaskbarOverlayContext overlayContext,
|
||||
@@ -237,7 +239,12 @@ public class KeyboardQuickSwitchViewController {
|
||||
|
||||
private void onCloseComplete() {
|
||||
mCloseAnimation = null;
|
||||
mOverlayContext.getDragLayer().removeView(mKeyboardQuickSwitchView);
|
||||
// Reset the view callbacks to prevent `onDetachedFromWindow` getting called in response to
|
||||
// the `removeView(mKeyboardQuickSwitchView)` call.
|
||||
mKeyboardQuickSwitchView.resetViewCallbacks();
|
||||
if (!mDetachingFromWindow) {
|
||||
mOverlayContext.getDragLayer().removeView(mKeyboardQuickSwitchView);
|
||||
}
|
||||
mControllerCallbacks.onCloseComplete();
|
||||
InteractionJankMonitorWrapper.end(Cuj.CUJ_LAUNCHER_KEYBOARD_QUICK_SWITCH_CLOSE);
|
||||
}
|
||||
@@ -327,5 +334,11 @@ public class KeyboardQuickSwitchViewController {
|
||||
boolean isAspectRatioSquare() {
|
||||
return mControllerCallbacks.isAspectRatioSquare();
|
||||
}
|
||||
|
||||
void onViewDetchedFromWindow() {
|
||||
mDetachingFromWindow = true;
|
||||
closeQuickSwitchView(false);
|
||||
mDetachingFromWindow = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user