diff options
| author | Alex Stetson <alexstetson@google.com> | 2022-05-04 14:13:58 -0700 |
|---|---|---|
| committer | Alex Stetson <alexstetson@google.com> | 2022-05-11 18:50:22 +0000 |
| commit | d9925dff1e676411f7c509df7347168d77f4e94b (patch) | |
| tree | b7f6d2a1d6248209436e47d963ade9c4f4f58aa7 /core/java/android/inputmethodservice/InputMethodService.java | |
| parent | 4d72ee1293b64aff418d13eaa859ab0ab07fd060 (diff) | |
Don't force nav bar shown if configured
There exists a configuration value to determine if the nav bar should
be shown when the keyboard is open. The InsetsPolicy should respect this
value. This value is currently used on automotive devices but doesn't
necessarily need to be restricted to a particular device type.
Bug: 229256359
Test: manual
Change-Id: I57ea71193476cb88bba8d406d039fe08e05a6b1c
Diffstat (limited to 'core/java/android/inputmethodservice/InputMethodService.java')
| -rw-r--r-- | core/java/android/inputmethodservice/InputMethodService.java | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/core/java/android/inputmethodservice/InputMethodService.java b/core/java/android/inputmethodservice/InputMethodService.java index 25296bc0a8b9..de6ade38bd0e 100644 --- a/core/java/android/inputmethodservice/InputMethodService.java +++ b/core/java/android/inputmethodservice/InputMethodService.java @@ -592,7 +592,7 @@ public class InputMethodService extends AbstractInputMethodService { private InlineSuggestionSessionController mInlineSuggestionSessionController; - private boolean mAutomotiveHideNavBarForKeyboard; + private boolean mHideNavBarForKeyboard; private boolean mIsAutomotive; private @NonNull OptionalInt mHandwritingRequestId = OptionalInt.empty(); private InputEventReceiver mHandwritingEventReceiver; @@ -1498,9 +1498,8 @@ public class InputMethodService extends AbstractInputMethodService { // shown the first time (cold start). mSettingsObserver.shouldShowImeWithHardKeyboard(); - mIsAutomotive = isAutomotive(); - mAutomotiveHideNavBarForKeyboard = getApplicationContext().getResources().getBoolean( - com.android.internal.R.bool.config_automotiveHideNavBarForKeyboard); + mHideNavBarForKeyboard = getApplicationContext().getResources().getBoolean( + com.android.internal.R.bool.config_hideNavBarForKeyboard); // TODO(b/111364446) Need to address context lifecycle issue if need to re-create // for update resources & configuration correctly when show soft input @@ -1539,11 +1538,11 @@ public class InputMethodService extends AbstractInputMethodService { window.setFlags(windowFlags, windowFlagsMask); // 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 screen real estate. When this happens, the IME window should animate from the + // (controlled via config_hideNavBarForKeyboard) in order to maximize the visible + // screen real estate. When this happens, the IME window should animate from the // bottom of the screen to reduce the jank that happens from the lack of synchronization // between the bottom system window and the IME window. - if (mIsAutomotive && mAutomotiveHideNavBarForKeyboard) { + if (mHideNavBarForKeyboard) { window.setDecorFitsSystemWindows(false); } } |
