Fix NPE in IMS#onEvaluateFullscreenMode

Fix NPE when EditorInfo is null

Test: Manually using steps in bug
Fix: 197078413
Bug: 197258697

Change-Id: I7437dec66f2cfe7769b9448916998c40745c3ebc
This commit is contained in:
Taran Singh
2021-08-18 23:29:21 +00:00
parent 8e97f22068
commit fabbcd1247

View File

@@ -1732,12 +1732,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_INTERNAL_FLAG_APP_WINDOW_PORTRAIT) != 0) {
& EditorInfo.IME_INTERNAL_FLAG_APP_WINDOW_PORTRAIT) != 0)) {
return false;
}
return true;