From d882ce1971110b517f5072b43ff4caab837193db Mon Sep 17 00:00:00 2001 From: Winson Chung Date: Wed, 5 Jun 2019 09:57:01 -0700 Subject: [PATCH] Ensure that the IME switcher button is always touchable Bug: 134521910 Test: Manual, plug in external keyboard and ensure the IME switcher is tappable Change-Id: Ic76fc3f85f2862a628810888b651ecaa284a4a5f --- .../systemui/statusbar/phone/NavigationBarView.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarView.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarView.java index 3ec16090ea871..4bc003647e4fd 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarView.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarView.java @@ -238,7 +238,19 @@ public class NavigationBarView extends FrameLayout implements info.setTouchableInsets(InternalInsetsInfo.TOUCHABLE_INSETS_FRAME); return; } + info.setTouchableInsets(InternalInsetsInfo.TOUCHABLE_INSETS_REGION); + ButtonDispatcher imeSwitchButton = getImeSwitchButton(); + if (imeSwitchButton.getVisibility() == VISIBLE) { + // If the IME is not up, but the ime switch button is visible, then make sure that + // button is touchable + int[] loc = new int[2]; + View buttonView = imeSwitchButton.getCurrentView(); + buttonView.getLocationInWindow(loc); + info.touchableRegion.set(loc[0], loc[1], loc[0] + buttonView.getWidth(), + loc[1] + buttonView.getHeight()); + return; + } info.touchableRegion.setEmpty(); };