Cleanup API checks for P, Q, and R.
Test: Build with gradle Flag: NA Change-Id: I3ef17090741d14bebd76cf09cf3dc5ac4f11e686
This commit is contained in:
1 parent
a601341ff5
commit
b922dccbf5
67 files changed
+117
-382
No files matched your search
@@ -265,29 +265,26 @@ public interface ActivityContext {
|
||||
if (root == null) {
|
||||
return;
|
||||
}
|
||||
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) {
|
||||
// Only hide the keyboard if it is actually showing.
|
||||
if (isImeShown) {
|
||||
// this method cannot be called cross threads
|
||||
wic.hide(WindowInsets.Type.ime());
|
||||
getStatsLogManager().logger().log(LAUNCHER_ALLAPPS_KEYBOARD_CLOSED);
|
||||
}
|
||||
|
||||
// If the WindowInsetsController is not null, we end here regardless of whether we
|
||||
// hid the keyboard or not.
|
||||
return;
|
||||
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) {
|
||||
// Only hide the keyboard if it is actually showing.
|
||||
if (isImeShown) {
|
||||
// this method cannot be called cross threads
|
||||
wic.hide(WindowInsets.Type.ime());
|
||||
getStatsLogManager().logger().log(LAUNCHER_ALLAPPS_KEYBOARD_CLOSED);
|
||||
}
|
||||
|
||||
// If the WindowInsetsController is not null, we end here regardless of whether we hid
|
||||
// the keyboard or not.
|
||||
return;
|
||||
}
|
||||
|
||||
InputMethodManager imm = root.getContext().getSystemService(InputMethodManager.class);
|
||||
|
||||
Reference in new issue
Block a user