}
private void initUI() {
- boolean autoTimeEnabled = getAutoState(Settings.System.AUTO_TIME);
- boolean autoTimeZoneEnabled = getAutoState(Settings.System.AUTO_TIME_ZONE);
+ boolean autoTimeEnabled = getAutoState(Settings.Global.AUTO_TIME);
+ boolean autoTimeZoneEnabled = getAutoState(Settings.Global.AUTO_TIME_ZONE);
Intent intent = getActivity().getIntent();
boolean isFirstRun = intent.getBooleanExtra(EXTRA_IS_FIRST_RUN, false);
updateTimeAndDateDisplay(getActivity());
} else if (key.equals(KEY_AUTO_TIME)) {
boolean autoEnabled = preferences.getBoolean(key, true);
- Settings.System.putInt(getContentResolver(), Settings.System.AUTO_TIME,
+ Settings.Global.putInt(getContentResolver(), Settings.Global.AUTO_TIME,
autoEnabled ? 1 : 0);
mTimePref.setEnabled(!autoEnabled);
mDatePref.setEnabled(!autoEnabled);
} else if (key.equals(KEY_AUTO_TIME_ZONE)) {
boolean autoZoneEnabled = preferences.getBoolean(key, true);
- Settings.System.putInt(
- getContentResolver(), Settings.System.AUTO_TIME_ZONE, autoZoneEnabled ? 1 : 0);
+ Settings.Global.putInt(
+ getContentResolver(), Settings.Global.AUTO_TIME_ZONE, autoZoneEnabled ? 1 : 0);
mTimeZone.setEnabled(!autoZoneEnabled);
}
}
private boolean getAutoState(String name) {
try {
- return Settings.System.getInt(getContentResolver(), name) > 0;
+ return Settings.Global.getInt(getContentResolver(), name) > 0;
} catch (SettingNotFoundException snfe) {
return false;
}
}
}
if (mAutoDateTimeButton != null) {
- Settings.System.putInt(getContentResolver(), Settings.System.AUTO_TIME,
+ Settings.Global.putInt(getContentResolver(), Settings.Global.AUTO_TIME,
mAutoDateTimeButton.isChecked() ? 1 : 0);
if (!mAutoDateTimeButton.isChecked()) {
DateTimeSettings.setDate(mDatePicker.getYear(), mDatePicker.getMonth(),
/*if (buttonView == mAutoTimeZoneButton) {
// In XL screen, we save all the state only when the next button is pressed.
if (!mUsingXLargeLayout) {
- Settings.System.putInt(getContentResolver(),
- Settings.System.AUTO_TIME_ZONE,
+ Settings.Global.putInt(getContentResolver(),
+ Settings.Global.AUTO_TIME_ZONE,
isChecked ? 1 : 0);
}
mTimeZone.setEnabled(!autoEnabled);
}
} else */
if (buttonView == mAutoDateTimeButton) {
- Settings.System.putInt(getContentResolver(),
- Settings.System.AUTO_TIME,
+ Settings.Global.putInt(getContentResolver(),
+ Settings.Global.AUTO_TIME,
isChecked ? 1 : 0);
mTimePicker.setEnabled(!autoEnabled);
mDatePicker.setEnabled(!autoEnabled);
private boolean isAutoDateTimeEnabled() {
try {
- return Settings.System.getInt(getContentResolver(), Settings.System.AUTO_TIME) > 0;
+ return Settings.Global.getInt(getContentResolver(), Settings.Global.AUTO_TIME) > 0;
} catch (SettingNotFoundException e) {
return true;
}
/*
private boolean isAutoTimeZoneEnabled() {
try {
- return Settings.System.getInt(getContentResolver(),
- Settings.System.AUTO_TIME_ZONE) > 0;
+ return Settings.Global.getInt(getContentResolver(),
+ Settings.Global.AUTO_TIME_ZONE) > 0;
} catch (SettingNotFoundException e) {
return true;
}