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

Commit f6710615 authored by satok's avatar satok
Browse files

Supplement for I772164d9c67e95876c228efcce2

This should be merged with I1519258dd3ce95ad01

Change-Id: I48c5f86ff43f51913eb69d697bb1d75714b67aa3
parent ac14351e
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -934,6 +934,7 @@ package android {
    field public static final int summaryOff = 16843248; // 0x10101f0
    field public static final int summaryOn = 16843247; // 0x10101ef
    field public static final int supportsRtl = 16843688; // 0x10103a8
    field public static final int supportsSentenceSpellCheck = 16843698; // 0x10103b2
    field public static final int supportsUploading = 16843419; // 0x101029b
    field public static final int switchMinWidth = 16843632; // 0x1010370
    field public static final int switchPadding = 16843633; // 0x1010371
@@ -25280,11 +25281,13 @@ package android.view.textservice {
    method public android.view.textservice.SpellCheckerInfo getSpellChecker();
    method public void getSuggestions(android.view.textservice.TextInfo, int);
    method public void getSuggestions(android.view.textservice.TextInfo[], int, boolean);
    method public boolean isSentenceSpellCheckSupported();
    method public boolean isSessionDisconnected();
    field public static final java.lang.String SERVICE_META_DATA = "android.view.textservice.scs";
  }
  public static abstract interface SpellCheckerSession.SpellCheckerSessionListener {
    method public abstract void onGetSentenceSuggestions(android.view.textservice.SentenceSuggestionsInfo[]);
    method public abstract void onGetSuggestions(android.view.textservice.SuggestionsInfo[]);
  }
+12 −0
Original line number Diff line number Diff line
@@ -45,6 +45,7 @@ public final class SpellCheckerInfo implements Parcelable {
    private final ResolveInfo mService;
    private final String mId;
    private final int mLabel;
    private final boolean mSupportsSentenceSpellCheck;

    /**
     * The spell checker setting activity's name, used by the system settings to
@@ -97,6 +98,9 @@ public final class SpellCheckerInfo implements Parcelable {
            label = sa.getResourceId(com.android.internal.R.styleable.SpellChecker_label, 0);
            settingsActivityComponent = sa.getString(
                    com.android.internal.R.styleable.SpellChecker_settingsActivity);
            mSupportsSentenceSpellCheck = sa.getBoolean(
                    com.android.internal.R.styleable.SpellChecker_supportsSentenceSpellCheck,
                    false);
            sa.recycle();

            final int depth = parser.getDepth();
@@ -138,6 +142,7 @@ public final class SpellCheckerInfo implements Parcelable {
     */
    public SpellCheckerInfo(Parcel source) {
        mLabel = source.readInt();
        mSupportsSentenceSpellCheck = source.readInt() != 0;
        mId = source.readString();
        mSettingsActivityName = source.readString();
        mService = ResolveInfo.CREATOR.createFromParcel(source);
@@ -152,6 +157,12 @@ public final class SpellCheckerInfo implements Parcelable {
        return mId;
    }

    /**
     * @hide
     */
    public boolean isSentenceSpellCheckSupported() {
        return mSupportsSentenceSpellCheck;
    }

    /**
     * Return the component of the service that implements.
@@ -177,6 +188,7 @@ public final class SpellCheckerInfo implements Parcelable {
    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeInt(mLabel);
        dest.writeInt(mSupportsSentenceSpellCheck ? 1 : 0);
        dest.writeString(mId);
        dest.writeString(mSettingsActivityName);
        mService.writeToParcel(dest, flags);
+5 −5
Original line number Diff line number Diff line
@@ -436,15 +436,15 @@ public class SpellCheckerSession {
     */
    public interface SpellCheckerSessionListener {
        /**
         * Callback for {@link SpellCheckerSession#getSuggestions(TextInfo[], int, boolean)}
         * Callback for {@link SpellCheckerSession#getSuggestions(TextInfo, int)}
         * and {@link SpellCheckerSession#getSuggestions(TextInfo[], int, boolean)}
         * @param results an array of {@link SuggestionsInfo}s.
         * These results are suggestions for {@link TextInfo}s queried by
         * {@link SpellCheckerSession#getSuggestions(TextInfo[], int, boolean)}.
         * {@link SpellCheckerSession#getSuggestions(TextInfo, int)} or
         * {@link SpellCheckerSession#getSuggestions(TextInfo[], int, boolean)}
         */
        public void onGetSuggestions(SuggestionsInfo[] results);
        // TODO: Remove @hide as soon as the sample spell checker client gets fixed.
        /**
         * @hide
         * Callback for {@link SpellCheckerSession#getSentenceSuggestions(TextInfo[], int)}
         * @param results an array of {@link SentenceSuggestionsInfo}s.
         * These results are suggestions for {@link TextInfo}s
@@ -494,7 +494,7 @@ public class SpellCheckerSession {
    }

    /**
     * @hide
     * @return true if the spell checker supports sentence level spell checking APIs
     */
    public boolean isSentenceSpellCheckSupported() {
        return mSubtype.containsExtraValueKey(SUPPORT_SENTENCE_SPELL_CHECK);
+2 −0
Original line number Diff line number Diff line
@@ -2349,6 +2349,8 @@
        <!-- Component name of an activity that allows the user to modify
             the settings for this service. -->
        <attr name="settingsActivity"/>
        <!-- Set true when the spell checker supports sentence level spell checking. -->
        <attr name="supportsSentenceSpellCheck" format="boolean" />
    </declare-styleable>

    <!-- This is the subtype of the spell checker. Subtype can describe locales (e.g. en_US, fr_FR...) -->
+1 −0
Original line number Diff line number Diff line
@@ -3578,4 +3578,5 @@

  <public type="attr" name="parentActivityName" />

  <public type="attr" name="supportsSentenceSpellCheck" />
</resources>