From 0ba45e4d5ee21098b67f62da1521c18e389f2a21 Mon Sep 17 00:00:00 2001 From: Hyunyoung Song Date: Mon, 14 Jun 2021 23:10:38 -0700 Subject: [PATCH] Remove IME visibility check before closing the keyboard Bug: 185890446 Test: manual TL;DR;; In racy condition, keyboard is not visible when the check happens but in next frame, it becomes visible. Change-Id: I3336f3c967804e5ccdea9110c363e92d83b7bc02 --- src/com/android/launcher3/util/UiThreadHelper.java | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/src/com/android/launcher3/util/UiThreadHelper.java b/src/com/android/launcher3/util/UiThreadHelper.java index b9387a87a3..cb721e68d0 100644 --- a/src/com/android/launcher3/util/UiThreadHelper.java +++ b/src/com/android/launcher3/util/UiThreadHelper.java @@ -25,11 +25,9 @@ import android.os.Handler; import android.os.IBinder; import android.os.Message; import android.view.View; -import android.view.WindowInsets; import android.view.inputmethod.InputMethodManager; import com.android.launcher3.Launcher; -import com.android.launcher3.Utilities; import com.android.launcher3.views.ActivityContext; /** @@ -48,14 +46,6 @@ public class UiThreadHelper { @SuppressLint("NewApi") public static void hideKeyboardAsync(ActivityContext activityContext, IBinder token) { View root = activityContext.getDragLayer(); - if (Utilities.ATLEAST_R) { - WindowInsets rootInsets = root.getRootWindowInsets(); - boolean isImeShown = rootInsets != null && rootInsets.isVisible( - WindowInsets.Type.ime()); - if (!isImeShown) { - return; - } - } Message.obtain(HANDLER.get(root.getContext()), MSG_HIDE_KEYBOARD, token).sendToTarget();