mirror of
https://github.com/ArcaneChat/android.git
synced 2026-07-03 14:05:24 +02:00
Merge pull request #4408 from deltachat/adb/issue-4152
add a setting to enable/disable calls notification
This commit is contained in:
@@ -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
|
||||
|
||||
+12
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user