From 693fa1a354e5363d9587d9a48d25e0969cfbbc0f Mon Sep 17 00:00:00 2001 From: beanstown106 Date: Sat, 14 Oct 2017 23:17:23 +0530 Subject: [PATCH] Cherish: incall vibration options [3/3] MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit *allow setting vibration when call is connected *allow setting vibration when call is disconnected *allow setting vibration for call waiting *this works with google and aosp dialer :) Change-Id: Id1a431124174571f8d0091825af2418971cfe35d Signed-off-by: Hưng Phan --- res/values/cherish_strings.xml | 6 ++++++ res/xml/cherish_settings_notifications.xml | 21 +++++++++++++++++++ .../fragments/NotificationSettings.java | 7 ++++++- 3 files changed, 33 insertions(+), 1 deletion(-) diff --git a/res/values/cherish_strings.xml b/res/values/cherish_strings.xml index 2a2fe1c..152f0f3 100644 --- a/res/values/cherish_strings.xml +++ b/res/values/cherish_strings.xml @@ -179,5 +179,11 @@ Annoying notifications protection Make heads up less annoying Show heads up only for dialer or messaging app if they are not in foreground + + + In-call vibration options + Vibrate on connect + Vibrate on call waiting + Vibrate on disconnect diff --git a/res/xml/cherish_settings_notifications.xml b/res/xml/cherish_settings_notifications.xml index 122bf94..0728ae9 100644 --- a/res/xml/cherish_settings_notifications.xml +++ b/res/xml/cherish_settings_notifications.xml @@ -65,4 +65,25 @@ + + + + + + + + + + diff --git a/src/com/cherish/settings/fragments/NotificationSettings.java b/src/com/cherish/settings/fragments/NotificationSettings.java index eeb1f5d..1a72afb 100644 --- a/src/com/cherish/settings/fragments/NotificationSettings.java +++ b/src/com/cherish/settings/fragments/NotificationSettings.java @@ -31,13 +31,13 @@ import com.cherish.settings.preferences.SystemSettingListPreference; import com.cherish.settings.preferences.SystemSettingSwitchPreference; import net.margaritov.preference.colorpicker.ColorPickerPreference; import com.android.internal.util.cherish.CherishUtils; - import java.util.ArrayList; import java.util.List; @SearchIndexable(forTarget = SearchIndexable.ALL & ~SearchIndexable.ARC) public class NotificationSettings extends SettingsPreferenceFragment implements Preference.OnPreferenceChangeListener{ + private static final String INCALL_VIB_OPTIONS = "incall_vib_options"; private Preference mChargingLeds; @Override public void onCreate(Bundle icicle) { @@ -54,6 +54,11 @@ public class NotificationSettings extends SettingsPreferenceFragment implements com.android.internal.R.bool.config_intrusiveBatteryLed)) { prefScreen.removePreference(mChargingLeds); } + + PreferenceCategory incallVibCategory = (PreferenceCategory) findPreference(INCALL_VIB_OPTIONS); + if (!CherishUtils.isVoiceCapable(getActivity())) { + prefScreen.removePreference(incallVibCategory); + } }