diff options
| author | Tiger Huang <tigerhuang@google.com> | 2020-11-08 19:04:16 +0800 |
|---|---|---|
| committer | Tiger Huang <tigerhuang@google.com> | 2020-11-08 19:12:36 +0800 |
| commit | 145f71182ab1c1e0be4f128683c97403c97d2696 (patch) | |
| tree | 1702cec68cbe4248ef66fe6509b8f938098ccd98 /core/java/android/inputmethodservice/InputMethodService.java | |
| parent | eefe559c722c0c4e1ddc7404665ccf1ae0156250 (diff) | |
Do let IME fit invisible insets
Otherwise, the fullscreen IME won't cover the entire display while
there is a hidden system bar.
Fix: 168657591
Test: 1. Steps in the bug.
2. Play WindowInsetsTests with combinations of system bar
visibilities, navigation mode, screen orientation, and display
cutout.
Change-Id: I6e7d665c55839dfbb14c8d2e5365537416f5f6c6
Diffstat (limited to 'core/java/android/inputmethodservice/InputMethodService.java')
| -rw-r--r-- | core/java/android/inputmethodservice/InputMethodService.java | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/core/java/android/inputmethodservice/InputMethodService.java b/core/java/android/inputmethodservice/InputMethodService.java index 44640c44332e..abc2a69a8dee 100644 --- a/core/java/android/inputmethodservice/InputMethodService.java +++ b/core/java/android/inputmethodservice/InputMethodService.java @@ -16,7 +16,6 @@ package android.inputmethodservice; -import static android.graphics.Color.TRANSPARENT; import static android.inputmethodservice.InputMethodServiceProto.CANDIDATES_VIEW_STARTED; import static android.inputmethodservice.InputMethodServiceProto.CANDIDATES_VISIBILITY; import static android.inputmethodservice.InputMethodServiceProto.CONFIGURATION; @@ -50,6 +49,7 @@ import static android.os.Trace.TRACE_TAG_WINDOW_MANAGER; import static android.view.ViewGroup.LayoutParams.MATCH_PARENT; import static android.view.ViewGroup.LayoutParams.WRAP_CONTENT; import static android.view.WindowInsets.Type.navigationBars; +import static android.view.WindowInsets.Type.statusBars; import static android.view.WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS; import static java.lang.annotation.RetentionPolicy.SOURCE; @@ -1244,13 +1244,8 @@ public class InputMethodService extends AbstractInputMethodService { Context.LAYOUT_INFLATER_SERVICE); mWindow = new SoftInputWindow(this, "InputMethod", mTheme, null, null, mDispatcherState, WindowManager.LayoutParams.TYPE_INPUT_METHOD, Gravity.BOTTOM, false); - mWindow.getWindow().getAttributes().setFitInsetsTypes(navigationBars()); + mWindow.getWindow().getAttributes().setFitInsetsTypes(statusBars() | navigationBars()); mWindow.getWindow().getAttributes().setFitInsetsSides(Side.all() & ~Side.BOTTOM); - mWindow.getWindow().getAttributes().setFitInsetsIgnoringVisibility(true); - - // Our window will extend into the status bar area no matter the bar is visible or not. - // We don't want the ColorView to be visible when status bar is shown. - mWindow.getWindow().setStatusBarColor(TRANSPARENT); // Automotive devices may request the navigation bar to be hidden when the IME shows up // (controlled via config_automotiveHideNavBarForKeyboard) in order to maximize the visible |
