Correctly handle when the user has no explicit time_12_24 setting
The code would previously interpret "null" (meaning the user
hasn't touched the setting in the Settings app) as meaning
"use 12 hour format". The actual meaning of "null" is
generally accepted in the platform as
"use the locale default". For example, the Settings app does
this, as does the code in libcore.icu.LocaleData. For
locales where the default is "use 12 hour format" anyway
this wasn't obvious. However, locales like Germany should
default to 24 hour, and then the setting is displayed
incorrectly in the Settings app.
Also, German devices boot for the first time with 12 hour SHORT
and MEDIUM time formats too. After the user had explicitly set
the format the setting would be correct.
There appear to be no tests for this behavior, presumably
because of the difficulty in forcing the setting to "unset"
which would have to have to happen before the app was launched,
and the fact that CTS tests run in the US locale.
Bug: 32868036
Test: Manual testing with a device set to German
Change-Id: Ifd2e8d345f6afee467d7525d6793fc8fda37c900
1 file changed