diff --git a/core/res/res/values/strings.xml b/core/res/res/values/strings.xml index 5242b955917b2..3fc0d95ded384 100644 --- a/core/res/res/values/strings.xml +++ b/core/res/res/values/strings.xml @@ -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. - - Taking screenshot for bug report in %d second. - Taking screenshot for bug report in %d seconds. - + {count, plural, + =1 {Taking screenshot for bug report in # second.} + other {Taking screenshot for bug report in # seconds.} + } + %s (%s) diff --git a/core/res/res/values/symbols.xml b/core/res/res/values/symbols.xml index 76e0994d7b185..6fca959263236 100644 --- a/core/res/res/values/symbols.xml +++ b/core/res/res/values/symbols.xml @@ -1260,9 +1260,9 @@ - + diff --git a/packages/Shell/src/com/android/shell/BugreportProgressService.java b/packages/Shell/src/com/android/shell/BugreportProgressService.java index c5a01a1c2b935..0b8bd9784b7de 100644 --- a/packages/Shell/src/com/android/shell/BugreportProgressService.java +++ b/packages/Shell/src/com/android/shell/BugreportProgressService.java @@ -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 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();