OSDN Git Service

Switch Utils.formatElapsedTime to use ICU's MeasureFormat
authorRoozbeh Pournader <roozbeh@google.com>
Tue, 20 Jun 2017 23:46:49 +0000 (16:46 -0700)
committerRoozbeh Pournader <roozbeh@google.com>
Thu, 22 Jun 2017 04:04:37 +0000 (21:04 -0700)
commit158722419337435fb4de2f06decd618c1cd9a5eb
tree7e1853234bd004a3594532aeea9c8298233bbf8c
parent2611734af5c8285716e7c7bdad940a9b4c6a2eab
Switch Utils.formatElapsedTime to use ICU's MeasureFormat

Previously, localizable strings were used instead, causing various
difficulties and inconsistencies.

Now we use ICU's MeasureFormat. The results for English are almost
identical to the previous results (see below), and we also get higher
quality and better-vetted results for other locales.

Note: This also makes formatted strings shorter by eliminating zeros.
For example, what was previously shown as "2d 0h 15m" is now shown as
"2d 15m".

Bug: 36994779
Bug: 37701311
Test: make -j RunSettingsRoboTests
Change-Id: I78fd09e4e7f63f41ef88d3d3fc4ba2be15e1d812
res/values/strings.xml
src/com/android/settings/Utils.java
tests/robotests/src/com/android/settings/UtilsTest.java