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
This commit is contained in:
@@ -16,7 +16,6 @@
|
|||||||
|
|
||||||
package android.inputmethodservice;
|
package android.inputmethodservice;
|
||||||
|
|
||||||
import static android.graphics.Color.TRANSPARENT;
|
|
||||||
import static android.inputmethodservice.InputMethodServiceProto.CANDIDATES_VIEW_STARTED;
|
import static android.inputmethodservice.InputMethodServiceProto.CANDIDATES_VIEW_STARTED;
|
||||||
import static android.inputmethodservice.InputMethodServiceProto.CANDIDATES_VISIBILITY;
|
import static android.inputmethodservice.InputMethodServiceProto.CANDIDATES_VISIBILITY;
|
||||||
import static android.inputmethodservice.InputMethodServiceProto.CONFIGURATION;
|
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.MATCH_PARENT;
|
||||||
import static android.view.ViewGroup.LayoutParams.WRAP_CONTENT;
|
import static android.view.ViewGroup.LayoutParams.WRAP_CONTENT;
|
||||||
import static android.view.WindowInsets.Type.navigationBars;
|
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 android.view.WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS;
|
||||||
|
|
||||||
import static java.lang.annotation.RetentionPolicy.SOURCE;
|
import static java.lang.annotation.RetentionPolicy.SOURCE;
|
||||||
@@ -1244,13 +1244,8 @@ public class InputMethodService extends AbstractInputMethodService {
|
|||||||
Context.LAYOUT_INFLATER_SERVICE);
|
Context.LAYOUT_INFLATER_SERVICE);
|
||||||
mWindow = new SoftInputWindow(this, "InputMethod", mTheme, null, null, mDispatcherState,
|
mWindow = new SoftInputWindow(this, "InputMethod", mTheme, null, null, mDispatcherState,
|
||||||
WindowManager.LayoutParams.TYPE_INPUT_METHOD, Gravity.BOTTOM, false);
|
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().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
|
// 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
|
// (controlled via config_automotiveHideNavBarForKeyboard) in order to maximize the visible
|
||||||
|
|||||||
@@ -499,11 +499,10 @@ public class DisplayPolicy {
|
|||||||
synchronized (mLock) {
|
synchronized (mLock) {
|
||||||
mDisplayContent.calculateSystemGestureExclusion(
|
mDisplayContent.calculateSystemGestureExclusion(
|
||||||
excludedRegion, null /* outUnrestricted */);
|
excludedRegion, null /* outUnrestricted */);
|
||||||
final boolean sideAllowed = mNavigationBarAlwaysShowOnSideGesture
|
final boolean excluded =
|
||||||
|| mNavigationBarPosition == NAV_BAR_RIGHT;
|
mSystemGestures.currentGestureStartedInRegion(excludedRegion);
|
||||||
if (mNavigationBar != null && sideAllowed
|
if (mNavigationBar != null && (mNavigationBarPosition == NAV_BAR_RIGHT
|
||||||
&& !mSystemGestures.currentGestureStartedInRegion(
|
|| !excluded && mNavigationBarAlwaysShowOnSideGesture)) {
|
||||||
excludedRegion)) {
|
|
||||||
requestTransientBars(mNavigationBar);
|
requestTransientBars(mNavigationBar);
|
||||||
}
|
}
|
||||||
checkAltBarSwipeForTransientBars(ALT_BAR_RIGHT);
|
checkAltBarSwipeForTransientBars(ALT_BAR_RIGHT);
|
||||||
@@ -517,11 +516,10 @@ public class DisplayPolicy {
|
|||||||
synchronized (mLock) {
|
synchronized (mLock) {
|
||||||
mDisplayContent.calculateSystemGestureExclusion(
|
mDisplayContent.calculateSystemGestureExclusion(
|
||||||
excludedRegion, null /* outUnrestricted */);
|
excludedRegion, null /* outUnrestricted */);
|
||||||
final boolean sideAllowed = mNavigationBarAlwaysShowOnSideGesture
|
final boolean excluded =
|
||||||
|| mNavigationBarPosition == NAV_BAR_LEFT;
|
mSystemGestures.currentGestureStartedInRegion(excludedRegion);
|
||||||
if (mNavigationBar != null && sideAllowed
|
if (mNavigationBar != null && (mNavigationBarPosition == NAV_BAR_LEFT
|
||||||
&& !mSystemGestures.currentGestureStartedInRegion(
|
|| !excluded && mNavigationBarAlwaysShowOnSideGesture)) {
|
||||||
excludedRegion)) {
|
|
||||||
requestTransientBars(mNavigationBar);
|
requestTransientBars(mNavigationBar);
|
||||||
}
|
}
|
||||||
checkAltBarSwipeForTransientBars(ALT_BAR_LEFT);
|
checkAltBarSwipeForTransientBars(ALT_BAR_LEFT);
|
||||||
|
|||||||
Reference in New Issue
Block a user