Merge pull request #4408 from deltachat/adb/issue-4152

add a setting to enable/disable calls notification
This commit is contained in:
adb
2026-05-07 18:19:27 +02:00
committed by GitHub
3 changed files with 19 additions and 0 deletions
+1
View File
@@ -15,6 +15,7 @@
* Show more recent added stickers at the top of the sticker picker
* Allow to open links in messages via actions in TalkBack menu
* Allow to open map if user clicks "Location streaming enabled" system message
* Allow to disable incoming calls notifications
* Fix: do not accidentally set draft in chats that don't allow sending messages
## v2.49.0
@@ -39,6 +39,7 @@ public class NotificationsPreferenceFragment extends ListSummaryPreferenceFragme
private CheckBoxPreference ignoreBattery;
private CheckBoxPreference notificationsEnabled;
private CheckBoxPreference mentionNotifEnabled;
private CheckBoxPreference notifyCalls;
private CheckBoxPreference reliableService;
private ActivityResultLauncher<Intent> ringtonePickerLauncher;
@@ -137,6 +138,16 @@ public class NotificationsPreferenceFragment extends ListSummaryPreferenceFragme
return true;
});
}
notifyCalls = this.findPreference("pref_notify_calls");
if (notifyCalls != null) {
notifyCalls.setOnPreferenceChangeListener(
(preference, newValue) -> {
boolean enabled = (Boolean) newValue;
dcContext.setConfig("who_can_call_me", enabled ? "1" : "2");
return true;
});
}
}
@Override
@@ -156,6 +167,7 @@ public class NotificationsPreferenceFragment extends ListSummaryPreferenceFragme
notificationsEnabled.setChecked(!dcContext.isMuted());
notificationsEnabled.setSummary(getSummary(getContext(), false));
mentionNotifEnabled.setChecked(dcContext.isMentionsEnabled());
notifyCalls.setChecked(dcContext.getConfig("who_can_call_me") != "2");
// set without altering "unset" state of the preference
reliableService.setOnPreferenceChangeListener(null);
@@ -56,6 +56,12 @@
android:title="@string/pref_in_chat_sounds"
android:defaultValue="true" />
<org.thoughtcrime.securesms.components.SwitchPreferenceCompat
android:key="pref_notify_calls"
android:title="@string/pref_calls"
android:summary="@string/pref_calls_explain"
android:defaultValue="true" />
<PreferenceCategory android:title="@string/pref_instant_delivery">
<org.thoughtcrime.securesms.components.SwitchPreferenceCompat
android:key="pref_ignore_battery_optimizations"