Close floating panels on Launcher when using Escape

This change will make the Escape key close floating panels in
Launcher.

Bug: 280801803
Test: Flashed on device, tried with physical keyboard and panels
will close.

Change-Id: Ie09e57716a7be74638037abe6272b47eec1b8a6c
This commit is contained in:
Josep del Rio
2023-05-04 16:07:50 +00:00
parent efb0c4e98c
commit 1d976c6702
+10
View File
@@ -3159,6 +3159,16 @@ public class Launcher extends StatefulActivity<LauncherState>
return super.onKeyShortcut(keyCode, event);
}
@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
if (keyCode == KeyEvent.KEYCODE_ESCAPE) {
// Close any open floating views.
closeOpenViews();
return true;
}
return super.onKeyDown(keyCode, event);
}
@Override
public boolean onKeyUp(int keyCode, KeyEvent event) {
if (keyCode == KeyEvent.KEYCODE_MENU) {