am 95b26e1a
: Merge "Overhaul vibrate and silent settings to match hard keys." into ics-mr1
* commit '95b26e1a4ae1d3bbef8811202e8aec3772f3bbe5': Overhaul vibrate and silent settings to match hard keys.
This commit is contained in:
@@ -550,20 +550,18 @@
|
|||||||
<item>auto</item>
|
<item>auto</item>
|
||||||
</string-array>
|
</string-array>
|
||||||
|
|
||||||
<!-- New incoming call vibrate options. -->
|
<!-- Silent mode options. -->
|
||||||
<string-array name="vibrate_entries">
|
<string-array name="silent_mode_entries">
|
||||||
<item>Always</item>
|
<item>Off</item>
|
||||||
<item>Never</item>
|
<item>Vibrate</item>
|
||||||
<item>Only in Silent mode</item>
|
<item>Mute</item>
|
||||||
<item>Only when not in Silent mode</item>
|
|
||||||
</string-array>
|
</string-array>
|
||||||
|
|
||||||
<!-- Values for vibrate_entries matching constants in SoundSettings. Do not translate. -->
|
<!-- Values for Silent mode. Do not translate. -->
|
||||||
<string-array name="vibrate_values" translatable="false">
|
<string-array name="silent_mode_values" translatable="false">
|
||||||
<item>always</item>
|
<item>off</item>
|
||||||
<item>never</item>
|
<item>vibrate</item>
|
||||||
<item>silent</item>
|
<item>mute</item>
|
||||||
<item>notsilent</item>
|
|
||||||
</string-array>
|
</string-array>
|
||||||
|
|
||||||
<!-- Titles for the list of long press timeout options. -->
|
<!-- Titles for the list of long press timeout options. -->
|
||||||
|
@@ -1511,7 +1511,7 @@
|
|||||||
<!-- Sound settings screen, setting option name checkbox -->
|
<!-- Sound settings screen, setting option name checkbox -->
|
||||||
<string name="vibrate_in_silent_title">Vibrate when silent</string>
|
<string name="vibrate_in_silent_title">Vibrate when silent</string>
|
||||||
<!-- Sound settings screen, setting option name checkbox -->
|
<!-- Sound settings screen, setting option name checkbox -->
|
||||||
<string name="vibrate_title">Vibrate</string>
|
<string name="vibrate_on_ring_title">Vibrate and ring</string>
|
||||||
<!-- Sound settings screen, setting option name -->
|
<!-- Sound settings screen, setting option name -->
|
||||||
<string name="notification_sound_title">Default notification</string>
|
<string name="notification_sound_title">Default notification</string>
|
||||||
<!-- Sound settings screen, notification light repeat pulsing title -->
|
<!-- Sound settings screen, notification light repeat pulsing title -->
|
||||||
|
@@ -27,16 +27,10 @@
|
|||||||
android:streamType="ring" />
|
android:streamType="ring" />
|
||||||
|
|
||||||
<ListPreference
|
<ListPreference
|
||||||
android:key="vibrate"
|
android:key="silent_mode"
|
||||||
android:title="@string/vibrate_title"
|
|
||||||
android:entries="@array/vibrate_entries"
|
|
||||||
android:entryValues="@array/vibrate_values" />
|
|
||||||
|
|
||||||
<CheckBoxPreference
|
|
||||||
android:key="silent"
|
|
||||||
android:title="@string/silent_mode_title"
|
android:title="@string/silent_mode_title"
|
||||||
android:persistent="false"
|
android:entries="@array/silent_mode_entries"
|
||||||
/>
|
android:entryValues="@array/silent_mode_values" />
|
||||||
|
|
||||||
<Preference
|
<Preference
|
||||||
android:key="musicfx"
|
android:key="musicfx"
|
||||||
@@ -64,6 +58,11 @@
|
|||||||
android:persistent="false"
|
android:persistent="false"
|
||||||
android:ringtoneType="notification" />
|
android:ringtoneType="notification" />
|
||||||
|
|
||||||
|
<CheckBoxPreference
|
||||||
|
android:key="vibrate_on_ring"
|
||||||
|
android:title="@string/vibrate_on_ring_title"
|
||||||
|
android:defaultValue="false" />
|
||||||
|
|
||||||
<PreferenceCategory
|
<PreferenceCategory
|
||||||
android:title="@string/sound_category_feedback_title"/>
|
android:title="@string/sound_category_feedback_title"/>
|
||||||
|
|
||||||
|
@@ -53,7 +53,7 @@ import android.widget.TextView;
|
|||||||
* Special preference type that allows configuration of both the ring volume and
|
* Special preference type that allows configuration of both the ring volume and
|
||||||
* notification volume.
|
* notification volume.
|
||||||
*/
|
*/
|
||||||
public class RingerVolumePreference extends VolumePreference implements OnClickListener {
|
public class RingerVolumePreference extends VolumePreference {
|
||||||
private static final String TAG = "RingerVolumePreference";
|
private static final String TAG = "RingerVolumePreference";
|
||||||
private static final int MSG_RINGER_MODE_CHANGED = 101;
|
private static final int MSG_RINGER_MODE_CHANGED = 101;
|
||||||
|
|
||||||
@@ -126,7 +126,6 @@ public class RingerVolumePreference extends VolumePreference implements OnClickL
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (mSeekBars[i] != null) {
|
if (mSeekBars[i] != null) {
|
||||||
mSeekBars[i].setEnabled(!muted);
|
|
||||||
final int volume = muted ? mAudioManager.getLastAudibleStreamVolume(streamType)
|
final int volume = muted ? mAudioManager.getLastAudibleStreamVolume(streamType)
|
||||||
: mAudioManager.getStreamVolume(streamType);
|
: mAudioManager.getStreamVolume(streamType);
|
||||||
mSeekBars[i].setProgress(volume);
|
mSeekBars[i].setProgress(volume);
|
||||||
@@ -176,9 +175,6 @@ public class RingerVolumePreference extends VolumePreference implements OnClickL
|
|||||||
// Register callbacks for mute/unmute buttons
|
// Register callbacks for mute/unmute buttons
|
||||||
for (int i = 0; i < mCheckBoxes.length; i++) {
|
for (int i = 0; i < mCheckBoxes.length; i++) {
|
||||||
ImageView checkbox = (ImageView) view.findViewById(CHECKBOX_VIEW_ID[i]);
|
ImageView checkbox = (ImageView) view.findViewById(CHECKBOX_VIEW_ID[i]);
|
||||||
if ((silentableStreams & (1 << SEEKBAR_TYPE[i])) != 0) {
|
|
||||||
checkbox.setOnClickListener(this);
|
|
||||||
}
|
|
||||||
mCheckBoxes[i] = checkbox;
|
mCheckBoxes[i] = checkbox;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -363,21 +359,4 @@ public class RingerVolumePreference extends VolumePreference implements OnClickL
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onClick(View v) {
|
|
||||||
// Touching any of the mute buttons causes us to get the state from the system and toggle it
|
|
||||||
switch(mAudioManager.getRingerMode()) {
|
|
||||||
case AudioManager.RINGER_MODE_NORMAL:
|
|
||||||
mAudioManager.setRingerMode(
|
|
||||||
(Settings.System.getInt(getContext().getContentResolver(),
|
|
||||||
Settings.System.VIBRATE_IN_SILENT, 1) == 1)
|
|
||||||
? AudioManager.RINGER_MODE_VIBRATE
|
|
||||||
: AudioManager.RINGER_MODE_SILENT);
|
|
||||||
break;
|
|
||||||
case AudioManager.RINGER_MODE_VIBRATE:
|
|
||||||
case AudioManager.RINGER_MODE_SILENT:
|
|
||||||
mAudioManager.setRingerMode(AudioManager.RINGER_MODE_NORMAL);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@@ -541,11 +541,11 @@ public class Settings extends PreferenceActivity implements ButtonBarHandler {
|
|||||||
@Override
|
@Override
|
||||||
public boolean onPreferenceStartFragment(PreferenceFragment caller, Preference pref) {
|
public boolean onPreferenceStartFragment(PreferenceFragment caller, Preference pref) {
|
||||||
// Override the fragment title for Wallpaper settings
|
// Override the fragment title for Wallpaper settings
|
||||||
CharSequence title = pref.getTitle();
|
int titleRes = pref.getTitleRes();
|
||||||
if (pref.getFragment().equals(WallpaperTypeSettings.class.getName())) {
|
if (pref.getFragment().equals(WallpaperTypeSettings.class.getName())) {
|
||||||
title = getString(R.string.wallpaper_settings_fragment_title);
|
titleRes = R.string.wallpaper_settings_fragment_title;
|
||||||
}
|
}
|
||||||
startPreferencePanel(pref.getFragment(), pref.getExtras(), 0, title, null, 0);
|
startPreferencePanel(pref.getFragment(), pref.getExtras(), titleRes, null, null, 0);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -55,8 +55,8 @@ public class SoundSettings extends SettingsPreferenceFragment implements
|
|||||||
/** If there is no setting in the provider, use this. */
|
/** If there is no setting in the provider, use this. */
|
||||||
private static final int FALLBACK_EMERGENCY_TONE_VALUE = 0;
|
private static final int FALLBACK_EMERGENCY_TONE_VALUE = 0;
|
||||||
|
|
||||||
private static final String KEY_SILENT = "silent";
|
private static final String KEY_SILENT_MODE = "silent_mode";
|
||||||
private static final String KEY_VIBRATE = "vibrate";
|
private static final String KEY_VIBRATE = "vibrate_on_ring";
|
||||||
private static final String KEY_RING_VOLUME = "ring_volume";
|
private static final String KEY_RING_VOLUME = "ring_volume";
|
||||||
private static final String KEY_MUSICFX = "musicfx";
|
private static final String KEY_MUSICFX = "musicfx";
|
||||||
private static final String KEY_DTMF_TONE = "dtmf_tone";
|
private static final String KEY_DTMF_TONE = "dtmf_tone";
|
||||||
@@ -69,10 +69,9 @@ public class SoundSettings extends SettingsPreferenceFragment implements
|
|||||||
private static final String KEY_NOTIFICATION_SOUND = "notification_sound";
|
private static final String KEY_NOTIFICATION_SOUND = "notification_sound";
|
||||||
private static final String KEY_CATEGORY_CALLS = "category_calls";
|
private static final String KEY_CATEGORY_CALLS = "category_calls";
|
||||||
|
|
||||||
private static final String VALUE_VIBRATE_NEVER = "never";
|
private static final String SILENT_MODE_OFF = "off";
|
||||||
private static final String VALUE_VIBRATE_ALWAYS = "always";
|
private static final String SILENT_MODE_VIBRATE = "vibrate";
|
||||||
private static final String VALUE_VIBRATE_ONLY_SILENT = "silent";
|
private static final String SILENT_MODE_MUTE = "mute";
|
||||||
private static final String VALUE_VIBRATE_UNLESS_SILENT = "notsilent";
|
|
||||||
|
|
||||||
private static final String[] NEED_VOICE_CAPABILITY = {
|
private static final String[] NEED_VOICE_CAPABILITY = {
|
||||||
KEY_RINGTONE, KEY_DTMF_TONE, KEY_CATEGORY_CALLS,
|
KEY_RINGTONE, KEY_DTMF_TONE, KEY_CATEGORY_CALLS,
|
||||||
@@ -82,16 +81,8 @@ public class SoundSettings extends SettingsPreferenceFragment implements
|
|||||||
private static final int MSG_UPDATE_RINGTONE_SUMMARY = 1;
|
private static final int MSG_UPDATE_RINGTONE_SUMMARY = 1;
|
||||||
private static final int MSG_UPDATE_NOTIFICATION_SUMMARY = 2;
|
private static final int MSG_UPDATE_NOTIFICATION_SUMMARY = 2;
|
||||||
|
|
||||||
private CheckBoxPreference mSilent;
|
private CheckBoxPreference mVibrateOnRing;
|
||||||
|
private ListPreference mSilentMode;
|
||||||
/*
|
|
||||||
* If we are currently in one of the silent modes (the ringer mode is set to either
|
|
||||||
* "silent mode" or "vibrate mode"), then toggling the "Phone vibrate"
|
|
||||||
* preference will switch between "silent mode" and "vibrate mode".
|
|
||||||
* Otherwise, it will adjust the normal ringer mode's ring or ring+vibrate
|
|
||||||
* setting.
|
|
||||||
*/
|
|
||||||
private ListPreference mVibrate;
|
|
||||||
private CheckBoxPreference mDtmfTone;
|
private CheckBoxPreference mDtmfTone;
|
||||||
private CheckBoxPreference mSoundEffects;
|
private CheckBoxPreference mSoundEffects;
|
||||||
private CheckBoxPreference mHapticFeedback;
|
private CheckBoxPreference mHapticFeedback;
|
||||||
@@ -143,14 +134,16 @@ public class SoundSettings extends SettingsPreferenceFragment implements
|
|||||||
getPreferenceScreen().removePreference(findPreference(KEY_EMERGENCY_TONE));
|
getPreferenceScreen().removePreference(findPreference(KEY_EMERGENCY_TONE));
|
||||||
}
|
}
|
||||||
|
|
||||||
mSilent = (CheckBoxPreference) findPreference(KEY_SILENT);
|
mSilentMode = (ListPreference) findPreference(KEY_SILENT_MODE);
|
||||||
if (!getResources().getBoolean(R.bool.has_silent_mode)) {
|
if (!getResources().getBoolean(R.bool.has_silent_mode)) {
|
||||||
getPreferenceScreen().removePreference(mSilent);
|
getPreferenceScreen().removePreference(mSilentMode);
|
||||||
findPreference(KEY_RING_VOLUME).setDependency(null);
|
findPreference(KEY_RING_VOLUME).setDependency(null);
|
||||||
|
} else {
|
||||||
|
mSilentMode.setOnPreferenceChangeListener(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
mVibrate = (ListPreference) findPreference(KEY_VIBRATE);
|
mVibrateOnRing = (CheckBoxPreference) findPreference(KEY_VIBRATE);
|
||||||
mVibrate.setOnPreferenceChangeListener(this);
|
mVibrateOnRing.setOnPreferenceChangeListener(this);
|
||||||
|
|
||||||
mDtmfTone = (CheckBoxPreference) findPreference(KEY_DTMF_TONE);
|
mDtmfTone = (CheckBoxPreference) findPreference(KEY_DTMF_TONE);
|
||||||
mDtmfTone.setPersistent(false);
|
mDtmfTone.setPersistent(false);
|
||||||
@@ -173,7 +166,7 @@ public class SoundSettings extends SettingsPreferenceFragment implements
|
|||||||
mNotificationPreference = findPreference(KEY_NOTIFICATION_SOUND);
|
mNotificationPreference = findPreference(KEY_NOTIFICATION_SOUND);
|
||||||
|
|
||||||
if (!((Vibrator) getSystemService(Context.VIBRATOR_SERVICE)).hasVibrator()) {
|
if (!((Vibrator) getSystemService(Context.VIBRATOR_SERVICE)).hasVibrator()) {
|
||||||
getPreferenceScreen().removePreference(mVibrate);
|
getPreferenceScreen().removePreference(mVibrateOnRing);
|
||||||
getPreferenceScreen().removePreference(mHapticFeedback);
|
getPreferenceScreen().removePreference(mHapticFeedback);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -241,100 +234,50 @@ public class SoundSettings extends SettingsPreferenceFragment implements
|
|||||||
getActivity().unregisterReceiver(mReceiver);
|
getActivity().unregisterReceiver(mReceiver);
|
||||||
}
|
}
|
||||||
|
|
||||||
private String getPhoneVibrateSettingValue() {
|
/**
|
||||||
boolean vibeInSilent = (Settings.System.getInt(
|
* Put the audio system into the correct vibrate setting
|
||||||
getContentResolver(),
|
*/
|
||||||
Settings.System.VIBRATE_IN_SILENT,
|
private void setPhoneVibrateSettingValue(boolean vibeOnRing) {
|
||||||
1) == 1);
|
// If vibrate-on-ring is checked, use VIBRATE_SETTING_ON
|
||||||
|
// Otherwise vibrate is off when ringer is silent
|
||||||
// Control phone vibe independent of silent mode
|
int vibrateMode = vibeOnRing ? AudioManager.VIBRATE_SETTING_ON
|
||||||
int callsVibrateSetting =
|
: AudioManager.VIBRATE_SETTING_ONLY_SILENT;
|
||||||
mAudioManager.getVibrateSetting(AudioManager.VIBRATE_TYPE_RINGER);
|
mAudioManager.setVibrateSetting(AudioManager.VIBRATE_TYPE_RINGER, vibrateMode);
|
||||||
|
|
||||||
if (vibeInSilent) {
|
|
||||||
if (callsVibrateSetting == AudioManager.VIBRATE_SETTING_OFF) {
|
|
||||||
// this state does not make sense; fix it up for the user
|
|
||||||
mAudioManager.setVibrateSetting(
|
|
||||||
AudioManager.VIBRATE_TYPE_RINGER,
|
|
||||||
AudioManager.VIBRATE_SETTING_ONLY_SILENT);
|
|
||||||
}
|
|
||||||
if (callsVibrateSetting == AudioManager.VIBRATE_SETTING_ON) {
|
|
||||||
return VALUE_VIBRATE_ALWAYS;
|
|
||||||
} else {
|
|
||||||
return VALUE_VIBRATE_ONLY_SILENT;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
if (callsVibrateSetting == AudioManager.VIBRATE_SETTING_ONLY_SILENT) {
|
|
||||||
// this state does not make sense; fix it up
|
|
||||||
mAudioManager.setVibrateSetting(
|
|
||||||
AudioManager.VIBRATE_TYPE_RINGER,
|
|
||||||
AudioManager.VIBRATE_SETTING_OFF);
|
|
||||||
}
|
|
||||||
if (callsVibrateSetting == AudioManager.VIBRATE_SETTING_ON) {
|
|
||||||
return VALUE_VIBRATE_UNLESS_SILENT;
|
|
||||||
} else {
|
|
||||||
return VALUE_VIBRATE_NEVER;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void setPhoneVibrateSettingValue(String value) {
|
private void setPhoneSilentSettingValue(String value) {
|
||||||
boolean vibeInSilent;
|
int ringerMode = AudioManager.RINGER_MODE_NORMAL;
|
||||||
int callsVibrateSetting;
|
if (value.equals(SILENT_MODE_MUTE)) {
|
||||||
|
ringerMode = AudioManager.RINGER_MODE_SILENT;
|
||||||
if (value.equals(VALUE_VIBRATE_UNLESS_SILENT)) {
|
} else if (value.equals(SILENT_MODE_VIBRATE)) {
|
||||||
callsVibrateSetting = AudioManager.VIBRATE_SETTING_ON;
|
ringerMode = AudioManager.RINGER_MODE_VIBRATE;
|
||||||
vibeInSilent = false;
|
}
|
||||||
} else if (value.equals(VALUE_VIBRATE_NEVER)) {
|
mAudioManager.setRingerMode(ringerMode);
|
||||||
callsVibrateSetting = AudioManager.VIBRATE_SETTING_OFF;
|
|
||||||
vibeInSilent = false;
|
|
||||||
} else if (value.equals(VALUE_VIBRATE_ONLY_SILENT)) {
|
|
||||||
callsVibrateSetting = AudioManager.VIBRATE_SETTING_ONLY_SILENT;
|
|
||||||
vibeInSilent = true;
|
|
||||||
} else { //VALUE_VIBRATE_ALWAYS
|
|
||||||
callsVibrateSetting = AudioManager.VIBRATE_SETTING_ON;
|
|
||||||
vibeInSilent = true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Settings.System.putInt(getContentResolver(),
|
private String getPhoneSilentModeSettingValue() {
|
||||||
Settings.System.VIBRATE_IN_SILENT,
|
switch (mAudioManager.getRingerMode()) {
|
||||||
vibeInSilent ? 1 : 0);
|
case AudioManager.RINGER_MODE_NORMAL:
|
||||||
|
return SILENT_MODE_OFF;
|
||||||
// might need to switch the ringer mode from one kind of "silent" to
|
case AudioManager.RINGER_MODE_VIBRATE:
|
||||||
// another
|
return SILENT_MODE_VIBRATE;
|
||||||
if (mSilent.isChecked()) {
|
case AudioManager.RINGER_MODE_SILENT:
|
||||||
mAudioManager.setRingerMode(
|
return SILENT_MODE_MUTE;
|
||||||
vibeInSilent ? AudioManager.RINGER_MODE_VIBRATE
|
|
||||||
: AudioManager.RINGER_MODE_SILENT);
|
|
||||||
}
|
}
|
||||||
|
// Shouldn't happen
|
||||||
mAudioManager.setVibrateSetting(
|
return SILENT_MODE_OFF;
|
||||||
AudioManager.VIBRATE_TYPE_RINGER,
|
|
||||||
callsVibrateSetting);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// updateState in fact updates the UI to reflect the system state
|
// updateState in fact updates the UI to reflect the system state
|
||||||
private void updateState(boolean force) {
|
private void updateState(boolean force) {
|
||||||
if (getActivity() == null) return;
|
if (getActivity() == null) return;
|
||||||
|
|
||||||
final int ringerMode = mAudioManager.getRingerMode();
|
final int vibrateMode = mAudioManager.getVibrateSetting(AudioManager.VIBRATE_TYPE_RINGER);
|
||||||
|
|
||||||
// NB: in the UI we now simply call this "silent mode". A separate
|
mVibrateOnRing.setChecked(vibrateMode == AudioManager.VIBRATE_SETTING_ON);
|
||||||
// setting controls whether we're in RINGER_MODE_SILENT or
|
mSilentMode.setValue(getPhoneSilentModeSettingValue());
|
||||||
// RINGER_MODE_VIBRATE.
|
|
||||||
final boolean silentOrVibrateMode =
|
|
||||||
ringerMode != AudioManager.RINGER_MODE_NORMAL;
|
|
||||||
|
|
||||||
if (silentOrVibrateMode != mSilent.isChecked() || force) {
|
mSilentMode.setSummary(mSilentMode.getEntry());
|
||||||
mSilent.setChecked(silentOrVibrateMode);
|
|
||||||
}
|
|
||||||
|
|
||||||
String phoneVibrateSetting = getPhoneVibrateSettingValue();
|
|
||||||
|
|
||||||
if (! phoneVibrateSetting.equals(mVibrate.getValue()) || force) {
|
|
||||||
mVibrate.setValue(phoneVibrateSetting);
|
|
||||||
}
|
|
||||||
mVibrate.setSummary(mVibrate.getEntry());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void updateRingtoneName(int type, Preference preference, int msg) {
|
private void updateRingtoneName(int type, Preference preference, int msg) {
|
||||||
@@ -370,20 +313,7 @@ public class SoundSettings extends SettingsPreferenceFragment implements
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onPreferenceTreeClick(PreferenceScreen preferenceScreen, Preference preference) {
|
public boolean onPreferenceTreeClick(PreferenceScreen preferenceScreen, Preference preference) {
|
||||||
if (preference == mSilent) {
|
if (preference == mDtmfTone) {
|
||||||
if (mSilent.isChecked()) {
|
|
||||||
boolean vibeInSilent = (1 == Settings.System.getInt(
|
|
||||||
getContentResolver(),
|
|
||||||
Settings.System.VIBRATE_IN_SILENT,
|
|
||||||
1));
|
|
||||||
mAudioManager.setRingerMode(
|
|
||||||
vibeInSilent ? AudioManager.RINGER_MODE_VIBRATE
|
|
||||||
: AudioManager.RINGER_MODE_SILENT);
|
|
||||||
} else {
|
|
||||||
mAudioManager.setRingerMode(AudioManager.RINGER_MODE_NORMAL);
|
|
||||||
}
|
|
||||||
updateState(false);
|
|
||||||
} else if (preference == mDtmfTone) {
|
|
||||||
Settings.System.putInt(getContentResolver(), Settings.System.DTMF_TONE_WHEN_DIALING,
|
Settings.System.putInt(getContentResolver(), Settings.System.DTMF_TONE_WHEN_DIALING,
|
||||||
mDtmfTone.isChecked() ? 1 : 0);
|
mDtmfTone.isChecked() ? 1 : 0);
|
||||||
|
|
||||||
@@ -422,9 +352,10 @@ public class SoundSettings extends SettingsPreferenceFragment implements
|
|||||||
} catch (NumberFormatException e) {
|
} catch (NumberFormatException e) {
|
||||||
Log.e(TAG, "could not persist emergency tone setting", e);
|
Log.e(TAG, "could not persist emergency tone setting", e);
|
||||||
}
|
}
|
||||||
} else if (preference == mVibrate) {
|
} else if (preference == mVibrateOnRing) {
|
||||||
setPhoneVibrateSettingValue(objValue.toString());
|
setPhoneVibrateSettingValue((Boolean) objValue);
|
||||||
updateState(false);
|
} else if (preference == mSilentMode) {
|
||||||
|
setPhoneSilentSettingValue(objValue.toString());
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
Reference in New Issue
Block a user