befd6bb1ea
Tap down action in swipe up start zone may or may not be start of a navigation gesture - for example, it may be start of a tab on an icon in the task bar. If the user taps on the taskbar overflow button, closing the KQS on tap down produces unintended behavior (KQS is closed on tap down, and reopened on tap up). Additionally, this produces inconsistent behavior in response to app icon taps depending on whether gesture navigation is enabled or not. Instead, close KQS as part of `hideOverlayWindow()`, which gets called when a swipe gesture actually starts (note that KQS is added to the overlay's drag layer). Additionally, make sure that KeyboardQuickSwitchController state is reset if KeyboardQuickSwitchView gets detached from UI due to the taskbar overlay getting hidden (e.g. in response to home button). Without this, in certain situations, KQS may get hidden with the controller thinking the UI is still shown - in case the user releases the Alt + Tab key combination in this state, the shortcut would end up getting handled, and switch to the next task. Bug: 368119679 Test: Press and hold Alt+Tab (while an app is open). After KQS is open, Swipe up to transition to overflow, or home screen - KQS gets hidden. Releasing Alt+Tab is no-op. Test: Press and hold Alt+Tab (while an app is open) with three button navigation enabled. Press home button. KQS gets hidden. Releasting Alt+Tab is no-op. Test: Press and hold Alt+Tab. After KQS is open, open an app from task bar (either transient or persistent), or all apps list. KQS gets closed, Releasing Alt+Tab is no-op. Flag: EXEMPT bugfix Change-Id: I8b561db3c6ec8a9c7de93e330faf8e3e4d3c8f4e