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

Commit 5685e1ee authored by Matías Hernández's avatar Matías Hernández
Browse files

MetricStyle: Use Chronometer for paused durations, too

Formatting and rounding is slightly different between toValueString() and Chronometer's rendering; writing that code was a fun exercise but there's little point in trying to keep them in sync.

For this, added a setPausedDuration() method in Chronometer. Although in many cases this can be achieved simply by calling setBase with the proper offset, that doesn't really work in the RemoteViews scenario where a long time can elapse between creating the RemoteViews and applying it.

My previous CL also had an incorrect fall-through in the proto-related methods for Instant (oops) so fixed it and added unit tests.

Fixes: 438186501
Test: atest NotificationMetricStyleTest RemoteViewsTest RemoteViewsSerializerTest ChronometerTest
Flag: android.app.api_metric_style
Change-Id: I17745a0f299c45862ec50374722ce52daa039d46
parent 1f83e6a2
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment