Change EXTRA_TIME_PREF_24_HOUR_FORMAT from boolean to int

To better represent the possible settings values for the
"use 24 hour format" setting : "12", "24", unset (meaning
"use locale default") the platform is being changed.

The EXTRA_TIME_PREF_24_HOUR_FORMAT for the ACTION_TIME_CHANGED
is now an int, not a boolean. 0 means "12", 1 means "24" and
2 means "use locale default".

Bug: 32761619
Test: Manual test on device and make RunSettingsRoboTests
Change-Id: I9aae6f8d12c4724c829f2812626a6193e510dbf9
This commit is contained in:
Neil Fuller
2016-11-18 16:05:40 +00:00
parent 9a35bc6552
commit c0cea814a1
2 changed files with 49 additions and 2 deletions

View File

@@ -96,7 +96,10 @@ public class TimeFormatPreferenceController extends PreferenceController {
private void timeUpdated(boolean is24Hour) {
Intent timeChanged = new Intent(Intent.ACTION_TIME_CHANGED);
timeChanged.putExtra(Intent.EXTRA_TIME_PREF_24_HOUR_FORMAT, is24Hour);
int timeFormatPreference =
is24Hour ? Intent.EXTRA_TIME_PREF_VALUE_USE_24_HOUR
: Intent.EXTRA_TIME_PREF_VALUE_USE_12_HOUR;
timeChanged.putExtra(Intent.EXTRA_TIME_PREF_24_HOUR_FORMAT, timeFormatPreference);
mContext.sendBroadcast(timeChanged);
}