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

Commit 4b428dc2 authored by Gilles Debunne's avatar Gilles Debunne Committed by Android (Google) Code Review
Browse files

Merge "Fix around suggestionSpan."

parents 5cde33b7 a00972ab
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -37,6 +37,7 @@ import android.text.style.ScaleXSpan;
import android.text.style.StrikethroughSpan;
import android.text.style.StyleSpan;
import android.text.style.SubscriptSpan;
import android.text.style.SuggestionSpan;
import android.text.style.SuperscriptSpan;
import android.text.style.TextAppearanceSpan;
import android.text.style.TypefaceSpan;
@@ -566,7 +567,7 @@ public class TextUtils {
    /** @hide */
    public static final int ANNOTATION = 18;
    /** @hide */
    public static final int CORRECTION_SPAN = 19;
    public static final int SUGGESTION_SPAN = 19;

    /**
     * Flatten a CharSequence and whatever styles can be copied across processes
@@ -712,6 +713,10 @@ public class TextUtils {
                    readSpan(p, sp, new Annotation(p));
                    break;

                case SUGGESTION_SPAN:
                    readSpan(p, sp, new SuggestionSpan(p));
                    break;

                default:
                    throw new RuntimeException("bogus span encoding " + kind);
                }
+2 −2
Original line number Diff line number Diff line
@@ -26,7 +26,7 @@ import java.util.Arrays;
import java.util.Locale;

/**
 * Sets correction candidates of words under this span.
 * Holds suggestion candidates of words under this span.
 */
public class SuggestionSpan implements ParcelableSpan {

@@ -139,7 +139,7 @@ public class SuggestionSpan implements ParcelableSpan {

    @Override
    public int getSpanTypeId() {
        return TextUtils.CORRECTION_SPAN;
        return TextUtils.SUGGESTION_SPAN;
    }

    public static final Parcelable.Creator<SuggestionSpan> CREATOR =