Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e1284085 authored by Clara Bayarri's avatar Clara Bayarri Committed by Android (Google) Code Review
Browse files

Merge "Fix hint text updates in Extracted text mode"

parents beca9e71 d8c5e7fc
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -48364,6 +48364,7 @@ package android.view.inputmethod {
    field public static final int FLAG_SELECTING = 2; // 0x2
    field public static final int FLAG_SINGLE_LINE = 1; // 0x1
    field public int flags;
    field public java.lang.CharSequence hint;
    field public int partialEndOffset;
    field public int partialStartOffset;
    field public int selectionEnd;
+1 −0
Original line number Diff line number Diff line
@@ -52058,6 +52058,7 @@ package android.view.inputmethod {
    field public static final int FLAG_SELECTING = 2; // 0x2
    field public static final int FLAG_SINGLE_LINE = 1; // 0x1
    field public int flags;
    field public java.lang.CharSequence hint;
    field public int partialEndOffset;
    field public int partialStartOffset;
    field public int selectionEnd;
+1 −0
Original line number Diff line number Diff line
@@ -48861,6 +48861,7 @@ package android.view.inputmethod {
    field public static final int FLAG_SELECTING = 2; // 0x2
    field public static final int FLAG_SINGLE_LINE = 1; // 0x1
    field public int flags;
    field public java.lang.CharSequence hint;
    field public int partialEndOffset;
    field public int partialStartOffset;
    field public int selectionEnd;
+18 −11
Original line number Diff line number Diff line
@@ -86,6 +86,11 @@ public class ExtractedText implements Parcelable {
     */
    public int flags;

    /**
     * The hint that has been extracted.
     */
    public CharSequence hint;

    /**
     * Used to package this object into a {@link Parcel}.
     *
@@ -100,6 +105,7 @@ public class ExtractedText implements Parcelable {
        dest.writeInt(selectionStart);
        dest.writeInt(selectionEnd);
        dest.writeInt(this.flags);
        TextUtils.writeToParcel(hint, dest, flags);
    }

    /**
@@ -116,6 +122,7 @@ public class ExtractedText implements Parcelable {
                    res.selectionStart = source.readInt();
                    res.selectionEnd = source.readInt();
                    res.flags = source.readInt();
                    res.hint = TextUtils.CHAR_SEQUENCE_CREATOR.createFromParcel(source);
                    return res;
                }

+38 −38
Original line number Diff line number Diff line
@@ -1585,27 +1585,31 @@ public class Editor {
        outText.startOffset = 0;
        outText.selectionStart = mTextView.getSelectionStart();
        outText.selectionEnd = mTextView.getSelectionEnd();
        outText.hint = mTextView.getHint();
        return true;
    }

    boolean reportExtractedText() {
        final Editor.InputMethodState ims = mInputMethodState;
        if (ims != null) {
            final boolean contentChanged = ims.mContentChanged;
            if (contentChanged || ims.mSelectionModeChanged) {
                ims.mContentChanged = false;
        if (ims == null) {
            return false;
        }
        ims.mSelectionModeChanged = false;
        final ExtractedTextRequest req = ims.mExtractedTextRequest;
                if (req != null) {
                    InputMethodManager imm = InputMethodManager.peekInstance();
                    if (imm != null) {
        if (req == null) {
            return false;
        }
        final InputMethodManager imm = InputMethodManager.peekInstance();
        if (imm == null) {
            return false;
        }
        if (TextView.DEBUG_EXTRACT) {
            Log.v(TextView.LOG_TAG, "Retrieving extracted start="
                    + ims.mChangedStart
                    + " end=" + ims.mChangedEnd
                    + " delta=" + ims.mChangedDelta);
        }
                        if (ims.mChangedStart < 0 && !contentChanged) {
        if (ims.mChangedStart < 0 && !ims.mContentChanged) {
            ims.mChangedStart = EXTRACT_NOTHING;
        }
        if (extractTextInternal(req, ims.mChangedStart, ims.mChangedEnd,
@@ -1625,10 +1629,6 @@ public class Editor {
            ims.mContentChanged = false;
            return true;
        }
                    }
                }
            }
        }
        return false;
    }

Loading