if (preference == mAlarmInSilentModePref) {
int ringerModeStreamTypes = Settings.System.getInt(
getContentResolver(),
Settings.System.MODE_RINGER_STREAMS_AFFECTED, 0);
if (mAlarmInSilentModePref.isChecked()) {
ringerModeStreamTypes &= ~ALARM_STREAM_TYPE_BIT;
} else {
ringerModeStreamTypes |= ALARM_STREAM_TYPE_BIT;
}
Settings.System.putInt(getContentResolver(),
Settings.System.MODE_RINGER_STREAMS_AFFECTED,
ringerModeStreamTypes);
return true;
}
return super.onPreferenceTreeClick(preferenceScreen, preference);