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

Commit 9ebedd8f authored by Calvin Pan's avatar Calvin Pan
Browse files

Clean <plurals> in FillUi

Bug: 199230228
Test: make
Change-Id: I0a31b1178e60b2e5acf312b40bf749e433b95475
parent 4ffb7e88
Loading
Loading
Loading
Loading
+5 −4
Original line number Diff line number Diff line
@@ -5530,10 +5530,11 @@
    <string name="autofill_picker_no_suggestions">No autofill suggestions</string>

    <!-- Accessibility string to announce there are some autofill suggestions in the autofill picker. [CHAR LIMIT=NONE] -->
    <plurals name="autofill_picker_some_suggestions">
        <item quantity="one">One autofill suggestion</item>
        <item quantity="other"><xliff:g id="count" example="Two">%1$s</xliff:g> autofill suggestions</item>
    </plurals>
    <string name="autofill_picker_some_suggestions">{count, plural,
        =1    {One autofill suggestion}
        other {# autofill suggestions}
    }
    </string>

    <!-- Title for the autofill save dialog shown when the the contents of the activity can be saved
         by an autofill service, but the service does not know what the activity represents [CHAR LIMIT=NONE] -->
+1 −1
Original line number Diff line number Diff line
@@ -3506,7 +3506,7 @@
  <java-symbol type="id" name="autofill_save_yes" />
  <java-symbol type="string" name="autofill_error_cannot_autofill" />
  <java-symbol type="string" name="autofill_picker_no_suggestions" />
  <java-symbol type="plurals" name="autofill_picker_some_suggestions" />
  <java-symbol type="string" name="autofill_picker_some_suggestions" />
  <java-symbol type="string" name="autofill" />
  <java-symbol type="string" name="autofill_picker_accessibility_title " />
  <java-symbol type="string" name="autofill_update_title" />
+8 −2
Original line number Diff line number Diff line
@@ -32,6 +32,7 @@ import android.service.autofill.Dataset;
import android.service.autofill.Dataset.DatasetFieldFilter;
import android.service.autofill.FillResponse;
import android.text.TextUtils;
import android.util.PluralsMessageFormatter;
import android.util.Slog;
import android.util.TypedValue;
import android.view.ContextThemeWrapper;
@@ -63,7 +64,9 @@ import com.android.server.autofill.Helper;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.regex.Pattern;
import java.util.stream.Collectors;
@@ -898,8 +901,11 @@ final class FillUi {
            if (count <= 0) {
                text = mContext.getString(R.string.autofill_picker_no_suggestions);
            } else {
                text = mContext.getResources().getQuantityString(
                        R.plurals.autofill_picker_some_suggestions, count, count);
                Map<String, Object> arguments = new HashMap<>();
                arguments.put("count", count);
                text = PluralsMessageFormatter.format(mContext.getResources(),
                        arguments,
                        R.string.autofill_picker_some_suggestions);
            }
            mListView.announceForAccessibility(text);
        }