Drop the second unit from elapsed time if zero

Previously, we could get formatted strings like "1h 0min" which is
unnecessarily complex for users. Replace such cases with "1 h" if
the second unit is zero.

Fixes: 65426298
Test: bit FrameworksCoreTests:android.text.format.FormatterTest
Change-Id: I1d9828ec97f2cbfb7ce27c266a04d4c02b090d6d
2 files changed