diff --git a/boot/hiddenapi/hiddenapi-max-target-q.txt b/boot/hiddenapi/hiddenapi-max-target-q.txt index 4832dd184ec5..f70473c313e4 100644 --- a/boot/hiddenapi/hiddenapi-max-target-q.txt +++ b/boot/hiddenapi/hiddenapi-max-target-q.txt @@ -398,7 +398,7 @@ Lcom/android/internal/R$layout;->select_dialog_multichoice:I Lcom/android/internal/R$layout;->select_dialog_singlechoice:I Lcom/android/internal/R$layout;->webview_find:I Lcom/android/internal/R$layout;->zoom_magnify:I -Lcom/android/internal/R$plurals;->matches_found:I +Lcom/android/internal/R$string;->matches_found:I Lcom/android/internal/R$raw;->loaderror:I Lcom/android/internal/R$raw;->nodomain:I Lcom/android/internal/R$string;->byteShort:I diff --git a/core/java/android/webkit/FindActionModeCallback.java b/core/java/android/webkit/FindActionModeCallback.java index e011d51c51fd..b1d07f59dc4e 100644 --- a/core/java/android/webkit/FindActionModeCallback.java +++ b/core/java/android/webkit/FindActionModeCallback.java @@ -26,6 +26,7 @@ import android.text.Editable; import android.text.Selection; import android.text.Spannable; import android.text.TextWatcher; +import android.util.PluralsMessageFormatter; import android.view.ActionMode; import android.view.LayoutInflater; import android.view.Menu; @@ -35,6 +36,11 @@ import android.view.inputmethod.InputMethodManager; import android.widget.EditText; import android.widget.TextView; +import com.android.internal.R; + +import java.util.HashMap; +import java.util.Map; + /** * @hide */ @@ -180,9 +186,14 @@ public class FindActionModeCallback implements ActionMode.Callback, TextWatcher, if (mNumberOfMatches == 0) { mMatches.setText(com.android.internal.R.string.no_matches); } else { - mMatches.setText(mResources.getQuantityString( - com.android.internal.R.plurals.matches_found, mNumberOfMatches, - mActiveMatchIndex + 1, mNumberOfMatches)); + Map arguments = new HashMap<>(); + arguments.put("count", mActiveMatchIndex + 1); + arguments.put("total", mNumberOfMatches); + + mMatches.setText(PluralsMessageFormatter.format( + mResources, + arguments, + R.string.matches_found)); } mMatches.setVisibility(View.VISIBLE); } diff --git a/core/res/res/values/strings.xml b/core/res/res/values/strings.xml index 7eee6e3cddcb..e2a8193f171f 100644 --- a/core/res/res/values/strings.xml +++ b/core/res/res/values/strings.xml @@ -4191,12 +4191,11 @@ - - - 1 match - - %d of %d - + { count, plural, + =1 {# match} + other {# of {total}}} + } + Done diff --git a/core/res/res/values/symbols.xml b/core/res/res/values/symbols.xml index 9ec1810f7cb5..b2d898bd1920 100644 --- a/core/res/res/values/symbols.xml +++ b/core/res/res/values/symbols.xml @@ -1263,8 +1263,8 @@ - +