Commit 9e3552a9 authored by Shimi Zhang's avatar Shimi Zhang Committed by Chromium LUCI CQ

Spellcheck: Change the suggestionsLimit parameter

Android framework (TextView) uses SuggestionSpan.SUGGESTION_MAX_SIZE,
we should match the behavior in WebView and Chrome.

See https://cs.android.com/android/platform/superproject/+/master:frameworks/base/core/java/android/widget/SpellChecker.java;drc=401e3d4c842ce86569de4477138137dc07a6aa6f;l=318

Bug: b/177876412
Change-Id: I0583668645c953629b793b901e1b467058df2535
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2644318Reviewed-by: default avatarTim Volodine <timvolodine@chromium.org>
Commit-Queue: Shimi Zhang <ctzsm@chromium.org>
Cr-Commit-Position: refs/heads/master@{#846238}
parent 4b758896
...@@ -6,6 +6,7 @@ package org.chromium.components.spellcheck; ...@@ -6,6 +6,7 @@ package org.chromium.components.spellcheck;
import android.content.Context; import android.content.Context;
import android.os.SystemClock; import android.os.SystemClock;
import android.text.style.SuggestionSpan;
import android.view.textservice.SentenceSuggestionsInfo; import android.view.textservice.SentenceSuggestionsInfo;
import android.view.textservice.SpellCheckerSession; import android.view.textservice.SpellCheckerSession;
import android.view.textservice.SpellCheckerSession.SpellCheckerSessionListener; import android.view.textservice.SpellCheckerSession.SpellCheckerSessionListener;
...@@ -89,7 +90,8 @@ public class SpellCheckerSessionBridge implements SpellCheckerSessionListener { ...@@ -89,7 +90,8 @@ public class SpellCheckerSessionBridge implements SpellCheckerSessionListener {
text = text.substring(0, text.length() - 1); text = text.substring(0, text.length() - 1);
} }
mStartMs = SystemClock.elapsedRealtime(); mStartMs = SystemClock.elapsedRealtime();
mSpellCheckerSession.getSentenceSuggestions(new TextInfo[] {new TextInfo(text)}, 0); mSpellCheckerSession.getSentenceSuggestions(
new TextInfo[] {new TextInfo(text)}, SuggestionSpan.SUGGESTIONS_MAX_SIZE);
} }
/** /**
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment