Loading core/java/android/inputmethodservice/InputMethodService.java +20 −2 Original line number Diff line number Diff line Loading @@ -38,6 +38,7 @@ import android.app.Dialog; import android.compat.annotation.UnsupportedAppUsage; import android.content.ComponentName; import android.content.Context; import android.content.pm.PackageManager; import android.content.res.Configuration; import android.content.res.Resources; import android.content.res.TypedArray; Loading Loading @@ -451,6 +452,9 @@ public class InputMethodService extends AbstractInputMethodService { @Nullable private InlineSuggestionsRequestInfo mInlineSuggestionsRequestInfo = null; private boolean mAutomotiveHideNavBarForKeyboard; private boolean mIsAutomotive; /** * An opaque {@link Binder} token of window requesting {@link InputMethodImpl#showSoftInput} * The original app window token is passed from client app window. Loading Loading @@ -1230,6 +1234,11 @@ public class InputMethodService extends AbstractInputMethodService { super.onCreate(); mImm = (InputMethodManager)getSystemService(INPUT_METHOD_SERVICE); mSettingsObserver = SettingsObserver.createAndRegister(this); mIsAutomotive = isAutomotive(); mAutomotiveHideNavBarForKeyboard = getApplicationContext().getResources().getBoolean( com.android.internal.R.bool.config_automotiveHideNavBarForKeyboard); // TODO(b/111364446) Need to address context lifecycle issue if need to re-create // for update resources & configuration correctly when show soft input // in non-default display. Loading @@ -1239,12 +1248,16 @@ public class InputMethodService extends AbstractInputMethodService { WindowManager.LayoutParams.TYPE_INPUT_METHOD, Gravity.BOTTOM, false); mWindow.getWindow().getAttributes().setFitInsetsTypes(WindowInsets.Type.statusBars()); // IME layout should always be inset by navigation bar, no matter it's current visibility. // IME layout should always be inset by navigation bar, no matter its current visibility, // unless automotive requests it, since automotive may hide the navigation bar. mWindow.getWindow().getDecorView().setOnApplyWindowInsetsListener( (v, insets) -> v.onApplyWindowInsets( new WindowInsets.Builder(insets).setInsets( navigationBars(), insets.getInsetsIgnoringVisibility(navigationBars())) mIsAutomotive && mAutomotiveHideNavBarForKeyboard ? android.graphics.Insets.NONE : insets.getInsetsIgnoringVisibility(navigationBars()) ) .build())); // For ColorView in DecorView to work, FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS needs to be set Loading Loading @@ -3284,6 +3297,11 @@ public class InputMethodService extends AbstractInputMethodService { : IME_VISIBLE) : 0); } private boolean isAutomotive() { return getApplicationContext().getPackageManager().hasSystemFeature( PackageManager.FEATURE_AUTOMOTIVE); } /** * Performs a dump of the InputMethodService's internal state. Override * to add your own information to the dump. Loading core/java/android/inputmethodservice/SoftInputWindow.java +0 −13 Original line number Diff line number Diff line Loading @@ -21,7 +21,6 @@ import static java.lang.annotation.RetentionPolicy.SOURCE; import android.annotation.IntDef; import android.app.Dialog; import android.content.Context; import android.content.pm.PackageManager; import android.graphics.Rect; import android.os.Debug; import android.os.IBinder; Loading Loading @@ -51,7 +50,6 @@ public class SoftInputWindow extends Dialog { final int mWindowType; final int mGravity; final boolean mTakesFocus; final boolean mAutomotiveHideNavBarForKeyboard; private final Rect mBounds = new Rect(); @Retention(SOURCE) Loading Loading @@ -136,8 +134,6 @@ public class SoftInputWindow extends Dialog { mWindowType = windowType; mGravity = gravity; mTakesFocus = takesFocus; mAutomotiveHideNavBarForKeyboard = context.getResources().getBoolean( com.android.internal.R.bool.config_automotiveHideNavBarForKeyboard); initDockWindow(); } Loading Loading @@ -251,11 +247,6 @@ public class SoftInputWindow extends Dialog { windowModFlags |= WindowManager.LayoutParams.FLAG_NOT_TOUCH_MODAL; } if (isAutomotive() && mAutomotiveHideNavBarForKeyboard) { windowSetFlags |= WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS; windowModFlags |= WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS; } getWindow().setFlags(windowSetFlags, windowModFlags); } Loading Loading @@ -347,10 +338,6 @@ public class SoftInputWindow extends Dialog { mWindowState = newState; } private boolean isAutomotive() { return getContext().getPackageManager().hasSystemFeature(PackageManager.FEATURE_AUTOMOTIVE); } private static String stateToString(@SoftInputWindowState int state) { switch (state) { case SoftInputWindowState.TOKEN_PENDING: Loading Loading
core/java/android/inputmethodservice/InputMethodService.java +20 −2 Original line number Diff line number Diff line Loading @@ -38,6 +38,7 @@ import android.app.Dialog; import android.compat.annotation.UnsupportedAppUsage; import android.content.ComponentName; import android.content.Context; import android.content.pm.PackageManager; import android.content.res.Configuration; import android.content.res.Resources; import android.content.res.TypedArray; Loading Loading @@ -451,6 +452,9 @@ public class InputMethodService extends AbstractInputMethodService { @Nullable private InlineSuggestionsRequestInfo mInlineSuggestionsRequestInfo = null; private boolean mAutomotiveHideNavBarForKeyboard; private boolean mIsAutomotive; /** * An opaque {@link Binder} token of window requesting {@link InputMethodImpl#showSoftInput} * The original app window token is passed from client app window. Loading Loading @@ -1230,6 +1234,11 @@ public class InputMethodService extends AbstractInputMethodService { super.onCreate(); mImm = (InputMethodManager)getSystemService(INPUT_METHOD_SERVICE); mSettingsObserver = SettingsObserver.createAndRegister(this); mIsAutomotive = isAutomotive(); mAutomotiveHideNavBarForKeyboard = getApplicationContext().getResources().getBoolean( com.android.internal.R.bool.config_automotiveHideNavBarForKeyboard); // TODO(b/111364446) Need to address context lifecycle issue if need to re-create // for update resources & configuration correctly when show soft input // in non-default display. Loading @@ -1239,12 +1248,16 @@ public class InputMethodService extends AbstractInputMethodService { WindowManager.LayoutParams.TYPE_INPUT_METHOD, Gravity.BOTTOM, false); mWindow.getWindow().getAttributes().setFitInsetsTypes(WindowInsets.Type.statusBars()); // IME layout should always be inset by navigation bar, no matter it's current visibility. // IME layout should always be inset by navigation bar, no matter its current visibility, // unless automotive requests it, since automotive may hide the navigation bar. mWindow.getWindow().getDecorView().setOnApplyWindowInsetsListener( (v, insets) -> v.onApplyWindowInsets( new WindowInsets.Builder(insets).setInsets( navigationBars(), insets.getInsetsIgnoringVisibility(navigationBars())) mIsAutomotive && mAutomotiveHideNavBarForKeyboard ? android.graphics.Insets.NONE : insets.getInsetsIgnoringVisibility(navigationBars()) ) .build())); // For ColorView in DecorView to work, FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS needs to be set Loading Loading @@ -3284,6 +3297,11 @@ public class InputMethodService extends AbstractInputMethodService { : IME_VISIBLE) : 0); } private boolean isAutomotive() { return getApplicationContext().getPackageManager().hasSystemFeature( PackageManager.FEATURE_AUTOMOTIVE); } /** * Performs a dump of the InputMethodService's internal state. Override * to add your own information to the dump. Loading
core/java/android/inputmethodservice/SoftInputWindow.java +0 −13 Original line number Diff line number Diff line Loading @@ -21,7 +21,6 @@ import static java.lang.annotation.RetentionPolicy.SOURCE; import android.annotation.IntDef; import android.app.Dialog; import android.content.Context; import android.content.pm.PackageManager; import android.graphics.Rect; import android.os.Debug; import android.os.IBinder; Loading Loading @@ -51,7 +50,6 @@ public class SoftInputWindow extends Dialog { final int mWindowType; final int mGravity; final boolean mTakesFocus; final boolean mAutomotiveHideNavBarForKeyboard; private final Rect mBounds = new Rect(); @Retention(SOURCE) Loading Loading @@ -136,8 +134,6 @@ public class SoftInputWindow extends Dialog { mWindowType = windowType; mGravity = gravity; mTakesFocus = takesFocus; mAutomotiveHideNavBarForKeyboard = context.getResources().getBoolean( com.android.internal.R.bool.config_automotiveHideNavBarForKeyboard); initDockWindow(); } Loading Loading @@ -251,11 +247,6 @@ public class SoftInputWindow extends Dialog { windowModFlags |= WindowManager.LayoutParams.FLAG_NOT_TOUCH_MODAL; } if (isAutomotive() && mAutomotiveHideNavBarForKeyboard) { windowSetFlags |= WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS; windowModFlags |= WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS; } getWindow().setFlags(windowSetFlags, windowModFlags); } Loading Loading @@ -347,10 +338,6 @@ public class SoftInputWindow extends Dialog { mWindowState = newState; } private boolean isAutomotive() { return getContext().getPackageManager().hasSystemFeature(PackageManager.FEATURE_AUTOMOTIVE); } private static String stateToString(@SoftInputWindowState int state) { switch (state) { case SoftInputWindowState.TOKEN_PENDING: Loading