Make EditorInfo.internalImeOptions parcelable.

Followup to I5a5e73e1dec776665f28a7e2eb091b555198001b.
internalImeOptions field should be parcelable.

Fix: 157870379
Test: Manually using steps in bug
Change-Id: I12b442b8b2d8cf83aa4cc789133b42251ad2c191
This commit is contained in:
Taran Singh
2021-01-29 16:29:04 +00:00
parent 2d1e90b508
commit 2b4bd4c6fb
3 changed files with 6 additions and 5 deletions

View File

@@ -1732,7 +1732,7 @@ public class InputMethodService extends AbstractInputMethodService {
// 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) {
& EditorInfo.IME_INTERNAL_FLAG_APP_WINDOW_PORTRAIT) != 0) {
return false;
}
return true;

View File

@@ -299,7 +299,7 @@ public class EditorInfo implements InputType, Parcelable {
* {@link EditorInfo} is using {@link Configuration#ORIENTATION_PORTRAIT} mode.
* @hide
*/
public static final int IME_FLAG_APP_WINDOW_PORTRAIT = 0x80000000;
public static final int IME_INTERNAL_FLAG_APP_WINDOW_PORTRAIT = 0x00000001;
/**
* Generic unspecified type for {@link #imeOptions}.
@@ -321,7 +321,6 @@ public class EditorInfo implements InputType, Parcelable {
* 1 1 IME_ACTION_NEXT
* 11 IME_ACTION_DONE
* 111 IME_ACTION_PREVIOUS
* 1 IME_FLAG_APP_WINDOW_PORTRAIT
* 1 IME_FLAG_NO_PERSONALIZED_LEARNING
* 1 IME_FLAG_NO_FULLSCREEN
* 1 IME_FLAG_NAVIGATE_PREVIOUS
@@ -356,7 +355,7 @@ public class EditorInfo implements InputType, Parcelable {
* Masks for {@link internalImeOptions}
*
* <pre>
* 1 IME_FLAG_APP_WINDOW_PORTRAIT
* 1 IME_INTERNAL_FLAG_APP_WINDOW_PORTRAIT
* |-------|-------|-------|-------|</pre>
*/
@@ -984,6 +983,7 @@ public class EditorInfo implements InputType, Parcelable {
dest.writeInt(inputType);
dest.writeInt(imeOptions);
dest.writeString(privateImeOptions);
dest.writeInt(internalImeOptions);
TextUtils.writeToParcel(actionLabel, dest, flags);
dest.writeInt(actionId);
dest.writeInt(initialSelStart);
@@ -1019,6 +1019,7 @@ public class EditorInfo implements InputType, Parcelable {
res.inputType = source.readInt();
res.imeOptions = source.readInt();
res.privateImeOptions = source.readString();
res.internalImeOptions = source.readInt();
res.actionLabel = TextUtils.CHAR_SEQUENCE_CREATOR.createFromParcel(source);
res.actionId = source.readInt();
res.initialSelStart = source.readInt();

View File

@@ -8750,7 +8750,7 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener
}
}
if (getResources().getConfiguration().orientation == ORIENTATION_PORTRAIT) {
outAttrs.internalImeOptions |= EditorInfo.IME_FLAG_APP_WINDOW_PORTRAIT;
outAttrs.internalImeOptions |= EditorInfo.IME_INTERNAL_FLAG_APP_WINDOW_PORTRAIT;
}
if (isMultilineInputType(outAttrs.inputType)) {
// Multi-line text editors should always show an enter key.