Dismiss KQS when focused display changes
- When focused display changes, the KQS view doesn't receive any KeyEvents thus the view remains open even if user clicks or hits Esc while on a different display. - Use FocusState to dismiss KQS if the displayId changes. Bug: 382762871 Flag: com.android.launcher3.enable_alt_tab_kqs_on_connected_displays Test: m Change-Id: Ic34a2bc7863575449e5b5c88377da8b1a8d48c20
This commit is contained in:
1 parent
740de77860
commit
288e705c43
2 files changed
+18
-1
No files matched your search
@@ -18,6 +18,7 @@ package com.android.launcher3.taskbar;
|
||||
import static androidx.constraintlayout.widget.ConstraintLayout.LayoutParams.PARENT_ID;
|
||||
|
||||
import static com.android.launcher3.taskbar.TaskbarDesktopExperienceFlags.enableAltTabKqsFlatenning;
|
||||
import static com.android.launcher3.taskbar.TaskbarDesktopExperienceFlags.enableAltTabKqsOnConnectedDisplays;
|
||||
|
||||
import android.animation.Animator;
|
||||
import android.animation.AnimatorListenerAdapter;
|
||||
@@ -54,6 +55,7 @@ import com.android.launcher3.Utilities;
|
||||
import com.android.launcher3.anim.AnimatedFloat;
|
||||
import com.android.launcher3.testing.TestLogging;
|
||||
import com.android.launcher3.testing.shared.TestProtocol;
|
||||
import com.android.quickstep.SystemUiProxy;
|
||||
import com.android.quickstep.util.DesktopTask;
|
||||
import com.android.quickstep.util.GroupTask;
|
||||
import com.android.quickstep.util.SingleTask;
|
||||
@@ -450,6 +452,9 @@ public class KeyboardQuickSwitchView extends ConstraintLayout {
|
||||
// Unregister the back invoked callback after the view is closed and before the
|
||||
// mViewCallbacks is reset.
|
||||
unregisterOnBackInvokedCallback();
|
||||
if (enableAltTabKqsOnConnectedDisplays.isTrue()) {
|
||||
SystemUiProxy.INSTANCE.get(getContext()).getFocusState().removeListener(mViewCallbacks);
|
||||
}
|
||||
mViewCallbacks = null;
|
||||
}
|
||||
|
||||
@@ -616,6 +621,10 @@ public class KeyboardQuickSwitchView extends ConstraintLayout {
|
||||
displayedContent.setVisibility(VISIBLE);
|
||||
setVisibility(VISIBLE);
|
||||
requestFocus();
|
||||
if (enableAltTabKqsOnConnectedDisplays.isTrue()) {
|
||||
SystemUiProxy.INSTANCE.get(getContext()).getFocusState().addListener(
|
||||
mViewCallbacks);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in new issue
Block a user