diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/activities/devicesettings/DeviceSettingsPreferenceConst.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/activities/devicesettings/DeviceSettingsPreferenceConst.java index 7c6bcd6bf..4d5b514f5 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/activities/devicesettings/DeviceSettingsPreferenceConst.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/activities/devicesettings/DeviceSettingsPreferenceConst.java @@ -243,6 +243,7 @@ public class DeviceSettingsPreferenceConst { public static final String PREF_BLUETOOTH_CALLS_ENABLED = "bluetooth_calls_enabled"; public static final String PREF_DISPLAY_CALLER = "display_caller"; public static final String PREF_NOTIFICATION_DELAY_CALLS = "notification_delay_calls"; + public static final String PREF_CALL_REJECT_METHOD = "call_reject_method"; public static final String WIFI_HOTSPOT_SSID = "wifi_hotspot_ssid"; public static final String WIFI_HOTSPOT_PASSWORD = "wifi_hotspot_password"; diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/activities/devicesettings/DeviceSpecificSettingsFragment.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/activities/devicesettings/DeviceSpecificSettingsFragment.java index 696d43989..c9e8ef028 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/activities/devicesettings/DeviceSpecificSettingsFragment.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/activities/devicesettings/DeviceSpecificSettingsFragment.java @@ -415,6 +415,7 @@ public class DeviceSpecificSettingsFragment extends AbstractPreferenceFragment i addPreferenceHandlerFor(PREF_BLUETOOTH_CALLS_ENABLED); addPreferenceHandlerFor(PREF_DISPLAY_CALLER); addPreferenceHandlerFor(PREF_NOTIFICATION_DELAY_CALLS); + addPreferenceHandlerFor(PREF_CALL_REJECT_METHOD); addPreferenceHandlerFor(PREF_SLEEP_MODE_SLEEP_SCREEN); addPreferenceHandlerFor(PREF_SLEEP_MODE_SMART_ENABLE); diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/qhybrid/QHybridCoordinator.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/qhybrid/QHybridCoordinator.java index 3c95c439a..21bbcb88a 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/qhybrid/QHybridCoordinator.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/qhybrid/QHybridCoordinator.java @@ -246,6 +246,7 @@ public class QHybridCoordinator extends AbstractBLEDeviceCoordinator { R.xml.devicesettings_fossilhybridhr_all_fw, R.xml.devicesettings_autoremove_notifications, R.xml.devicesettings_canned_dismisscall_16, + R.xml.devicesettings_reject_call_method, R.xml.devicesettings_transliteration, R.xml.devicesettings_fossilhybridhr_dev }; diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/qhybrid/adapter/fossil_hr/FossilHRWatchAdapter.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/qhybrid/adapter/fossil_hr/FossilHRWatchAdapter.java index ac491b8f1..858dc08d6 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/qhybrid/adapter/fossil_hr/FossilHRWatchAdapter.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/qhybrid/adapter/fossil_hr/FossilHRWatchAdapter.java @@ -1982,11 +1982,16 @@ public class FossilHRWatchAdapter extends FossilWatchAdapter { } private void handleCallRequest(byte[] value) { + SharedPreferences prefs = getDeviceSpecificPreferences(); + String rejectMethodPref = prefs.getString(DeviceSettingsPreferenceConst.PREF_CALL_REJECT_METHOD, "reject"); + GBDeviceEventCallControl.Event rejectMethod = GBDeviceEventCallControl.Event.REJECT; + if (rejectMethodPref.equals("ignore")) rejectMethod = GBDeviceEventCallControl.Event.IGNORE; + boolean acceptCall = value[7] == (byte) 0x00; queueWrite(new PlayCallNotificationRequest("", false, false, 0,this)); GBDeviceEventCallControl callControlEvent = new GBDeviceEventCallControl(); - callControlEvent.event = acceptCall ? GBDeviceEventCallControl.Event.START : GBDeviceEventCallControl.Event.REJECT; + callControlEvent.event = acceptCall ? GBDeviceEventCallControl.Event.START : rejectMethod; getDeviceSupport().evaluateGBDeviceEvent(callControlEvent); } diff --git a/app/src/main/res/drawable/ic_phone_missed_outline.xml b/app/src/main/res/drawable/ic_phone_missed_outline.xml index 26a30a968..1be9e11c3 100644 --- a/app/src/main/res/drawable/ic_phone_missed_outline.xml +++ b/app/src/main/res/drawable/ic_phone_missed_outline.xml @@ -2,8 +2,9 @@ android:width="24dp" android:height="24dp" android:viewportWidth="24" - android:viewportHeight="24"> + android:viewportHeight="24" + android:tint="#7E7E7E"> diff --git a/app/src/main/res/values/arrays.xml b/app/src/main/res/values/arrays.xml index 259ec48e4..75b35d916 100644 --- a/app/src/main/res/values/arrays.xml +++ b/app/src/main/res/values/arrays.xml @@ -3466,5 +3466,13 @@ normal precise + + @string/call_rejection_method_reject + @string/call_rejection_method_ignore + + + reject + ignore + diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 72e854e5a..4c75e3043 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -2390,4 +2390,8 @@ Fahrenheit Navigation app not installed on watch Navigation started but navigationApp not installed on watch. Please install it from the App Manager. + Reject + Ignore (silence) + Call rejection method + Which action is taken when an incoming call is rejected from the watch diff --git a/app/src/main/res/xml/devicesettings_reject_call_method.xml b/app/src/main/res/xml/devicesettings_reject_call_method.xml new file mode 100644 index 000000000..c9b9d8a78 --- /dev/null +++ b/app/src/main/res/xml/devicesettings_reject_call_method.xml @@ -0,0 +1,12 @@ + + + + +