summaryrefslogtreecommitdiff
path: root/core/java/android/inputmethodservice/InputMethodService.java
diff options
context:
space:
mode:
authorTaran Singh <tarandeep@google.com>2020-11-18 15:04:27 -0800
committerTaran Singh <tarandeep@google.com>2020-12-21 05:57:47 -0800
commitdc211bfac3e8f6e75f8b9e7a6f31c112f30d4901 (patch)
treeb8c7fe7f6ec36737f5aae281a12b0982ee89b1de /core/java/android/inputmethodservice/InputMethodService.java
parenta0334be887757324e671e09e4563034704c66fb0 (diff)
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
Diffstat (limited to 'core/java/android/inputmethodservice/InputMethodService.java')
-rw-r--r--core/java/android/inputmethodservice/InputMethodService.java8
1 files changed, 6 insertions, 2 deletions
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;