From c66dd0af0250a3923904bf8d3c9c9474023a15b1 Mon Sep 17 00:00:00 2001 From: Ming-Shin Lu Date: Sun, 18 Apr 2021 22:28:22 +0800 Subject: Fix not invoke setImeWindowStatus when unlocked by PIN lock CL[1] removed setImeWindowStatatus call in showSoftInput() since showWindow() has a call. Howerver, the call invokes only when the IME visibility has changed. It overlooked the case that when the screen unlocked by PIN lock, since the focused app and IME visiblity is the same, so the setImeWindowStatus in showWindow() doesn't invoked. When then keyguard shown, IMMS side will invoke updateSystemUiLocked to update navbar icon as invisible, so after the user unlocked, user won't see the navbar icon set visible back. As the result, we still need setImeWindowStatus called in showSoftInput to fix this case. [1]: I0b0750f146634d8e90e0b0ac46e9208675626d0a Fix: 181294561 Test: manual as below steps: 0) setup PIN lock for the device 1) launch an app (e.g. Messaging) and show IME 2) turn-off the screen and unlock the screen with PIN 3) verify if the keyboard is visible and the navbar icon is visible Change-Id: I168fda76c1c7bdcabe94f7c2550c6b5c7c41e5e0 --- core/java/android/inputmethodservice/InputMethodService.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'core/java/android/inputmethodservice/InputMethodService.java') diff --git a/core/java/android/inputmethodservice/InputMethodService.java b/core/java/android/inputmethodservice/InputMethodService.java index f03da7cd390b..4b8e37c56061 100644 --- a/core/java/android/inputmethodservice/InputMethodService.java +++ b/core/java/android/inputmethodservice/InputMethodService.java @@ -819,10 +819,9 @@ public class InputMethodService extends AbstractInputMethodService { if (dispatchOnShowInputRequested(flags, false)) { showWindow(true); applyVisibilityInInsetsConsumerIfNecessary(true /* setVisible */); - } else { - // If user uses hard keyboard, IME button should always be shown. - setImeWindowStatus(mapToImeWindowStatus(), mBackDisposition); } + setImeWindowStatus(mapToImeWindowStatus(), mBackDisposition); + final boolean isVisible = isInputViewShown(); final boolean visibilityChanged = isVisible != wasVisible; if (resultReceiver != null) { -- cgit v1.2.3