Fix midnight-to-next-midnight bug in DateIntervalFormat.

There is special handling in DateIntervalFormat.formatDateRange for
ranges which end at midnight. When showing times, and the end-point is
midnight of the day following the start-point, it suppresses the end
date so that it shows e.g. "February 27, 04:00 - 00:00" instead of
"February 27, 04:00 - February 28, 00:00". This behaviour is broken
when the start date is also midnight, we need the dates there to
disambiguate (rather than creating an empty range). This change
addresses that, while preserving all other behaviours.

Tests are added to cover various aspects of this special casing. The
second of the four assertions added fails without this change.

Bug: 68847519
Test: cts-tradefed run cts-dev -m CtsLibcoreTestCases
Test: cts-tradefed run cts-dev -m CtsTextTestCases -t android.text.format.cts.DateUtilsTest
Change-Id: I7d109af69e1962163b74c5837fd782156765fbe2
3 files changed