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

Commit 4ffb7e88 authored by Calvin Pan's avatar Calvin Pan
Browse files

Clean <plurals> in BugreportProgressService

Bug: 199230228
Test: make
Change-Id: I888c65c8819eb5443178ddfc2097d3519b89cefb
parent bf4e15d0
Loading
Loading
Loading
Loading
+5 −4
Original line number Diff line number Diff line
@@ -689,10 +689,11 @@
        your device is unresponsive or too slow, or when you need all report sections.
        Does not allow you to enter more details or take additional screenshots.</string>
    <!--  Toast message informing user in how many seconds a bugreport screenshot will be taken -->
    <plurals name="bugreport_countdown">
        <item quantity="one">Taking screenshot for bug report in <xliff:g id="number">%d</xliff:g> second.</item>
        <item quantity="other">Taking screenshot for bug report in <xliff:g id="number">%d</xliff:g> seconds.</item>
    </plurals>
    <string name="bugreport_countdown">{count, plural,
        =1 {Taking screenshot for bug report in # second.}
        other {Taking screenshot for bug report in # seconds.}
    }
    </string>

    <!-- Format for build summary info [CHAR LIMIT=NONE] -->
    <string name="bugreport_status" translatable="false">%s (%s)</string>
+1 −1
Original line number Diff line number Diff line
@@ -1260,9 +1260,9 @@
  <java-symbol type="string" name="conference_call" />
  <java-symbol type="string" name="tooltip_popup_title" />

  <java-symbol type="plurals" name="bugreport_countdown" />
  <java-symbol type="plurals" name="last_num_days" />
  <java-symbol type="plurals" name="restr_pin_countdown" />
  <java-symbol type="string" name="bugreport_countdown" />
  <java-symbol type="string" name="file_count" />
  <java-symbol type="string" name="matches_found" />
  <java-symbol type="plurals" name="pinpuk_attempts" />
+9 −3
Original line number Diff line number Diff line
@@ -72,6 +72,7 @@ import android.text.format.DateUtils;
import android.util.Log;
import android.util.Pair;
import android.util.Patterns;
import android.util.PluralsMessageFormatter;
import android.util.SparseArray;
import android.view.ContextThemeWrapper;
import android.view.IWindowManager;
@@ -111,7 +112,9 @@ import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.Enumeration;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.concurrent.Executor;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.concurrent.atomic.AtomicInteger;
@@ -943,9 +946,12 @@ public class BugreportProgressService extends Service {
        }
        setTakingScreenshot(true);
        collapseNotificationBar();
        final String msg = mContext.getResources()
                .getQuantityString(com.android.internal.R.plurals.bugreport_countdown,
                        mScreenshotDelaySec, mScreenshotDelaySec);
        Map<String, Object> arguments = new HashMap<>();
        arguments.put("count", mScreenshotDelaySec);
        final String msg = PluralsMessageFormatter.format(
                mContext.getResources(),
                arguments,
                com.android.internal.R.string.bugreport_countdown);
        Log.i(TAG, msg);
        // Show a toast just once, otherwise it might be captured in the screenshot.
        Toast.makeText(mContext, msg, Toast.LENGTH_SHORT).show();