summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDanny Baumann <dannybaumann@web.de>2013-07-01 11:54:44 +0200
committerDanny Baumann <dannybaumann@web.de>2013-07-02 16:46:58 +0200
commit5d68d4bf506b539ea9027cad638eaba211155969 (patch)
treed3c60d00892edd4acb62615100ed02b66daad31b
parent260c191d802b685fda63205b5426aa1af35163bb (diff)
downloadpackages_apps_settings-5d68d4bf506b539ea9027cad638eaba211155969.zip
packages_apps_settings-5d68d4bf506b539ea9027cad638eaba211155969.tar.gz
packages_apps_settings-5d68d4bf506b539ea9027cad638eaba211155969.tar.bz2
Add an option to allow a (subtle) notification vibration during calls.
Change-Id: I7dfbb64334e0e8e7f98d38bf503c053ff1880658 JIRA:CYAN-1550
-rw-r--r--res/values/cm_strings.xml4
-rw-r--r--res/xml/sound_settings.xml7
-rw-r--r--src/com/android/settings/SoundSettings.java12
3 files changed, 23 insertions, 0 deletions
diff --git a/res/values/cm_strings.xml b/res/values/cm_strings.xml
index 1769df4..cf6d49d 100644
--- a/res/values/cm_strings.xml
+++ b/res/values/cm_strings.xml
@@ -105,6 +105,10 @@
<string name="notification_convert_sound_to_vibration_title">Vibrate on notification</string>
<string name="notification_convert_sound_to_vibration_summary">In vibrate mode, all notifications will vibrate regardless of individual app settings</string>
+ <!-- vibrate during phone calls -->
+ <string name="notification_vibrate_during_calls_title">Vibrate during call</string>
+ <string name="notification_vibrate_during_calls_summary">Incoming notifications will softly vibrate during phone calls</string>
+
<!-- Hostname setting -->
<string name="device_hostname">Device hostname</string>
diff --git a/res/xml/sound_settings.xml b/res/xml/sound_settings.xml
index b552634..116855a 100644
--- a/res/xml/sound_settings.xml
+++ b/res/xml/sound_settings.xml
@@ -128,6 +128,13 @@
android:summary="@string/notification_convert_sound_to_vibration_summary"
android:defaultValue="true" />
+ <CheckBoxPreference
+ android:key="notification_vibrate_during_calls"
+ android:title="@string/notification_vibrate_during_calls_title"
+ android:summary="@string/notification_vibrate_during_calls_summary"
+ android:persistent="false"
+ android:defaultValue="false" />
+
<!-- Dock -->
<PreferenceCategory
android:key="dock_category"
diff --git a/src/com/android/settings/SoundSettings.java b/src/com/android/settings/SoundSettings.java
index d7a5c97..b73ed45 100644
--- a/src/com/android/settings/SoundSettings.java
+++ b/src/com/android/settings/SoundSettings.java
@@ -90,6 +90,7 @@ public class SoundSettings extends SettingsPreferenceFragment implements
private static final String KEY_VOLBTN_MUSIC_CTRL = "volbtn_music_controls";
private static final String KEY_HEADSET_CONNECT_PLAYER = "headset_connect_player";
private static final String KEY_CONVERT_SOUND_TO_VIBRATE = "notification_convert_sound_to_vibration";
+ private static final String KEY_VIBRATE_DURING_CALLS = "notification_vibrate_during_calls";
private static final String KEY_SAFE_HEADSET_VOLUME = "safe_headset_volume";
private static final String KEY_VOLUME_ADJUST_SOUNDS = "volume_adjust_sounds";
private static final String KEY_POWER_NOTIFICATIONS = "power_notifications";
@@ -126,6 +127,7 @@ public class SoundSettings extends SettingsPreferenceFragment implements
private CheckBoxPreference mVolBtnMusicCtrl;
private CheckBoxPreference mHeadsetConnectPlayer;
private CheckBoxPreference mConvertSoundToVibration;
+ private CheckBoxPreference mVibrateDuringCalls;
private Preference mRingtonePreference;
private Preference mNotificationPreference;
private PreferenceScreen mQuietHours;
@@ -273,6 +275,10 @@ public class SoundSettings extends SettingsPreferenceFragment implements
mConvertSoundToVibration.setChecked(Settings.System.getInt(resolver,
Settings.System.NOTIFICATION_CONVERT_SOUND_TO_VIBRATION, 1) != 0);
+ mVibrateDuringCalls = (CheckBoxPreference) findPreference(KEY_VIBRATE_DURING_CALLS);
+ mVibrateDuringCalls.setChecked(Settings.System.getInt(resolver,
+ Settings.System.NOTIFICATION_VIBRATE_DURING_ALERTS_DISABLED, 0) != 0);
+
mRingtonePreference = findPreference(KEY_RINGTONE);
mNotificationPreference = findPreference(KEY_NOTIFICATION_SOUND);
@@ -281,6 +287,7 @@ public class SoundSettings extends SettingsPreferenceFragment implements
removePreference(KEY_VIBRATE);
removePreference(KEY_HAPTIC_FEEDBACK);
removePreference(KEY_CONVERT_SOUND_TO_VIBRATE);
+ removePreference(KEY_VIBRATE_DURING_CALLS);
}
if (TelephonyManager.PHONE_TYPE_CDMA == activePhoneType) {
@@ -491,6 +498,11 @@ public class SoundSettings extends SettingsPreferenceFragment implements
Settings.System.putInt(getContentResolver(), Settings.System.NOTIFICATION_CONVERT_SOUND_TO_VIBRATION,
mConvertSoundToVibration.isChecked() ? 1 : 0);
+ } else if (preference == mVibrateDuringCalls) {
+ Settings.System.putInt(getContentResolver(),
+ Settings.System.NOTIFICATION_VIBRATE_DURING_ALERTS_DISABLED,
+ mVibrateDuringCalls.isChecked() ? 1 : 0);
+
} else if (preference == mMusicFx) {
// let the framework fire off the intent
return false;