Commits

Anonymous committed 0a2bc1c

Revert "Revert "Set 24 hour pref. with ACTION_TIME_CHANGED.""

This reverts commit 9ebc27c73e7096159024605a2c4ab1a4b3abbd83.

Change-Id: Id440bd004fee696472aeec9eefa5732755b19627

Comments (0)

Files changed (1)

src/com/android/settings/DateTimeSettings.java

 import android.content.SharedPreferences;
 import android.content.SharedPreferences.OnSharedPreferenceChangeListener;
 import android.os.Bundle;
-import android.os.SystemClock;
 import android.preference.CheckBoxPreference;
 import android.preference.ListPreference;
 import android.preference.Preference;
 import android.view.View;
 import android.widget.DatePicker;
 import android.widget.TimePicker;
-
 import java.text.SimpleDateFormat;
 import java.util.Calendar;
 import java.util.Date;
             removeDialog(DIALOG_TIMEPICKER);
             showDialog(DIALOG_TIMEPICKER);
         } else if (preference == mTime24Pref) {
-            set24Hour(((CheckBoxPreference)mTime24Pref).isChecked());
+            final boolean is24Hour = ((CheckBoxPreference)mTime24Pref).isChecked();
+            set24Hour(is24Hour);
             updateTimeAndDateDisplay(getActivity());
-            timeUpdated();
+            timeUpdated(is24Hour);
         }
         return super.onPreferenceTreeClick(preferenceScreen, preference);
     }
         updateTimeAndDateDisplay(getActivity());
     }
 
-    private void timeUpdated() {
+    private void timeUpdated(boolean is24Hour) {
         Intent timeChanged = new Intent(Intent.ACTION_TIME_CHANGED);
+        timeChanged.putExtra(Intent.EXTRA_TIME_PREF_24_HOUR_FORMAT, is24Hour);
         getActivity().sendBroadcast(timeChanged);
     }