Loading quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/NoButtonNavbarToOverviewTouchController.java +1 −1 Original line number Diff line number Diff line Loading @@ -86,7 +86,7 @@ public class NoButtonNavbarToOverviewTouchController extends PortraitStatesTouch @Override protected boolean canInterceptTouch(MotionEvent ev) { mDidTouchStartInNavBar = (ev.getEdgeFlags() & EDGE_NAV_BAR) != 0; return super.canInterceptTouch(ev); return super.canInterceptTouch(ev) && !mLauncher.isInState(HINT_STATE); } @Override Loading src/com/android/launcher3/ExtendedEditText.java +1 −0 Original line number Diff line number Diff line Loading @@ -104,6 +104,7 @@ public class ExtendedEditText extends EditText { public void hideKeyboard() { hideKeyboardAsync(ActivityContext.lookupContext(getContext()), getWindowToken()); clearFocus(); } private boolean showSoftInput() { Loading src/com/android/launcher3/util/UiThreadHelper.java +28 −1 Original line number Diff line number Diff line Loading @@ -25,9 +25,13 @@ import android.os.Bundle; import android.os.Handler; import android.os.IBinder; import android.os.Message; import android.util.Log; import android.view.View; import android.view.WindowInsets; import android.view.WindowInsetsController; import android.view.inputmethod.InputMethodManager; import com.android.launcher3.Utilities; import com.android.launcher3.views.ActivityContext; /** Loading @@ -48,6 +52,29 @@ public class UiThreadHelper { public static void hideKeyboardAsync(ActivityContext activityContext, IBinder token) { View root = activityContext.getDragLayer(); if (Utilities.ATLEAST_R) { Preconditions.assertUIThread(); // Hide keyboard with WindowInsetsController if could. In case // hideSoftInputFromWindow may get ignored by input connection being finished // when the screen is off. // // In addition, inside IMF, the keyboards are closed asynchronously that launcher no // longer need to post to the message queue. final WindowInsetsController wic = root.getWindowInsetsController(); WindowInsets insets = root.getRootWindowInsets(); boolean isImeShown = insets != null && insets.isVisible(WindowInsets.Type.ime()); if (wic != null && isImeShown) { // this method cannot be called cross threads wic.hide(WindowInsets.Type.ime()); activityContext.getStatsLogManager().logger() .log(LAUNCHER_ALLAPPS_KEYBOARD_CLOSED); return; } else { // print which stack trace failed. Log.e("Launcher", "hideKeyboard ignored.", new Exception()); // Then attempt to use the old logic. } } // Since the launcher context cannot be accessed directly from callback, adding secondary // message to log keyboard close event asynchronously. Bundle mHideKeyboardLoggerMsg = new Bundle(); Loading @@ -55,7 +82,7 @@ public class UiThreadHelper { STATS_LOGGER_KEY, Message.obtain( HANDLER.get(root.getContext()), () -> ActivityContext.lookupContext(root.getContext()) () -> activityContext .getStatsLogManager() .logger() .log(LAUNCHER_ALLAPPS_KEYBOARD_CLOSED) Loading Loading
quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/NoButtonNavbarToOverviewTouchController.java +1 −1 Original line number Diff line number Diff line Loading @@ -86,7 +86,7 @@ public class NoButtonNavbarToOverviewTouchController extends PortraitStatesTouch @Override protected boolean canInterceptTouch(MotionEvent ev) { mDidTouchStartInNavBar = (ev.getEdgeFlags() & EDGE_NAV_BAR) != 0; return super.canInterceptTouch(ev); return super.canInterceptTouch(ev) && !mLauncher.isInState(HINT_STATE); } @Override Loading
src/com/android/launcher3/ExtendedEditText.java +1 −0 Original line number Diff line number Diff line Loading @@ -104,6 +104,7 @@ public class ExtendedEditText extends EditText { public void hideKeyboard() { hideKeyboardAsync(ActivityContext.lookupContext(getContext()), getWindowToken()); clearFocus(); } private boolean showSoftInput() { Loading
src/com/android/launcher3/util/UiThreadHelper.java +28 −1 Original line number Diff line number Diff line Loading @@ -25,9 +25,13 @@ import android.os.Bundle; import android.os.Handler; import android.os.IBinder; import android.os.Message; import android.util.Log; import android.view.View; import android.view.WindowInsets; import android.view.WindowInsetsController; import android.view.inputmethod.InputMethodManager; import com.android.launcher3.Utilities; import com.android.launcher3.views.ActivityContext; /** Loading @@ -48,6 +52,29 @@ public class UiThreadHelper { public static void hideKeyboardAsync(ActivityContext activityContext, IBinder token) { View root = activityContext.getDragLayer(); if (Utilities.ATLEAST_R) { Preconditions.assertUIThread(); // Hide keyboard with WindowInsetsController if could. In case // hideSoftInputFromWindow may get ignored by input connection being finished // when the screen is off. // // In addition, inside IMF, the keyboards are closed asynchronously that launcher no // longer need to post to the message queue. final WindowInsetsController wic = root.getWindowInsetsController(); WindowInsets insets = root.getRootWindowInsets(); boolean isImeShown = insets != null && insets.isVisible(WindowInsets.Type.ime()); if (wic != null && isImeShown) { // this method cannot be called cross threads wic.hide(WindowInsets.Type.ime()); activityContext.getStatsLogManager().logger() .log(LAUNCHER_ALLAPPS_KEYBOARD_CLOSED); return; } else { // print which stack trace failed. Log.e("Launcher", "hideKeyboard ignored.", new Exception()); // Then attempt to use the old logic. } } // Since the launcher context cannot be accessed directly from callback, adding secondary // message to log keyboard close event asynchronously. Bundle mHideKeyboardLoggerMsg = new Bundle(); Loading @@ -55,7 +82,7 @@ public class UiThreadHelper { STATS_LOGGER_KEY, Message.obtain( HANDLER.get(root.getContext()), () -> ActivityContext.lookupContext(root.getContext()) () -> activityContext .getStatsLogManager() .logger() .log(LAUNCHER_ALLAPPS_KEYBOARD_CLOSED) Loading