Register back action to close the KQS view

As the KQS view is not extending the floating view, we have to
explicitly register the back action to close the KQS view.

Bug: 379778483
Test: open KQS via alt-tab/overflow button and tap the back button
Flag: com.android.launcher3.taskbar_overflow
Change-Id: I140813d1792f0c17aee5f9f8dd9fa3ed8b40ba6c
This commit is contained in:
Wen-Chien Wang
2024-11-21 21:44:59 +00:00
committed by Wen-chien Wang
parent d091b42778
commit ecc50c6d7c
2 changed files with 38 additions and 0 deletions
@@ -25,6 +25,7 @@ import android.view.Gravity;
import android.view.KeyEvent;
import android.view.MotionEvent;
import android.view.animation.AnimationUtils;
import android.window.OnBackInvokedCallback;
import android.window.RemoteTransition;
import androidx.annotation.NonNull;
@@ -330,6 +331,7 @@ public class KeyboardQuickSwitchViewController {
}
class ViewCallbacks {
public final OnBackInvokedCallback onBackInvokedCallback = () -> closeQuickSwitchView(true);
boolean onKeyUp(int keyCode, KeyEvent event, boolean isRTL, boolean allowTraversal) {
if (keyCode != KeyEvent.KEYCODE_TAB