From dc211bfac3e8f6e75f8b9e7a6f31c112f30d4901 Mon Sep 17 00:00:00 2001 From: Taran Singh Date: Wed, 18 Nov 2020 15:04:27 -0800 Subject: Prevent Fullscreen IME when app is in portrait. When an app is running in portrait orientation, regardless of what orientation display is in, IME shouldn't use fullscreen-mode. Setting IME_FLAG_NO_FULLSCREEN in EditorInfo makes sure IME doesn't go fullscreen. Bug: 157870379 Test: Manually using steps in bug Change-Id: I5a5e73e1dec776665f28a7e2eb091b555198001b --- core/java/android/inputmethodservice/InputMethodService.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'core/java/android/inputmethodservice/InputMethodService.java') diff --git a/core/java/android/inputmethodservice/InputMethodService.java b/core/java/android/inputmethodservice/InputMethodService.java index 6831eca32f72..df9a7c2cb586 100644 --- a/core/java/android/inputmethodservice/InputMethodService.java +++ b/core/java/android/inputmethodservice/InputMethodService.java @@ -1700,8 +1700,12 @@ public class InputMethodService extends AbstractInputMethodService { if (config.orientation != Configuration.ORIENTATION_LANDSCAPE) { return false; } - if (mInputEditorInfo != null - && (mInputEditorInfo.imeOptions & EditorInfo.IME_FLAG_NO_FULLSCREEN) != 0) { + if ((mInputEditorInfo != null + && (mInputEditorInfo.imeOptions & EditorInfo.IME_FLAG_NO_FULLSCREEN) != 0) + // If app window has portrait orientation, regardless of what display orientation + // is, IME shouldn't use fullscreen-mode. + || (mInputEditorInfo.internalImeOptions + & EditorInfo.IME_FLAG_APP_WINDOW_PORTRAIT) != 0) { return false; } return true; -- cgit v1.2.3