Merge "Use IMM.hideSoftInputFromWindow to close the window" into sc-dev am: e2522016ae

Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/14529286

Change-Id: I76f9fe875b28637e3273783746fc4b8d1ec26613
diff --git a/src/com/android/launcher3/util/UiThreadHelper.java b/src/com/android/launcher3/util/UiThreadHelper.java
index 523f3d6..947f96f 100644
--- a/src/com/android/launcher3/util/UiThreadHelper.java
+++ b/src/com/android/launcher3/util/UiThreadHelper.java
@@ -50,11 +50,9 @@
             WindowInsets rootInsets = root.getRootWindowInsets();
             boolean isImeShown = rootInsets != null && rootInsets.isVisible(
                     WindowInsets.Type.ime());
-            if (isImeShown) {
-                // this call is already asynchronous
-                root.getWindowInsetsController().hide(WindowInsets.Type.ime());
+            if (!isImeShown) {
+                return;
             }
-            return;
         }
 
         Message.obtain(HANDLER.get(root.getContext()),