just use defaults for led-pattern, it is no longer supported since andoid8; in-chat sounds are independent from global-notification-switch

This commit is contained in:
B. Petersen
2020-05-17 22:22:49 +02:00
parent fd4404c1e3
commit 1e60eb9c1a
5 changed files with 8 additions and 40 deletions
-12
View File
@@ -117,18 +117,6 @@
<item>none</item>
</string-array>
<string-array name="pref_led_blink_pattern_entries">
<item>@string/fast</item>
<item>@string/normal</item>
<item>@string/slow</item>
</string-array>
<string-array name="pref_led_blink_pattern_values" translatable="false">
<item>300,300</item>
<item>500,2000</item>
<item>3000,3000</item>
</string-array>
<string-array name="default_or_custom_values" translatable="false">
<item>default</item>
<item>custom</item>
+5 -14
View File
@@ -35,20 +35,6 @@
android:entries="@array/pref_led_color_entries"
android:entryValues="@array/pref_led_color_values" />
<ListPreference
android:key="pref_led_blink"
android:defaultValue="500,2000"
android:title="@string/pref_led_pattern"
android:dependency="pref_led_color"
android:entries="@array/pref_led_blink_pattern_entries"
android:entryValues="@array/pref_led_blink_pattern_values" />
<org.thoughtcrime.securesms.components.SwitchPreferenceCompat
android:key="pref_key_inthread_notifications"
android:title="@string/pref_in_chat_sounds"
android:dependency="pref_key_enable_notifications"
android:defaultValue="true" />
<ListPreference
android:key="pref_notification_privacy"
android:title="@string/pref_notifications_show"
@@ -65,4 +51,9 @@
android:entries="@array/pref_notification_priority_entries"
android:entryValues="@array/pref_notification_priority_values"/>
<org.thoughtcrime.securesms.components.SwitchPreferenceCompat
android:key="pref_key_inthread_notifications"
android:title="@string/pref_in_chat_sounds"
android:defaultValue="true" />
</PreferenceScreen>
@@ -72,6 +72,7 @@ abstract class AbstractNotificationBuilder extends NotificationCompat.Builder {
}
private void setLed() {
/*
String ledColor = Prefs.getNotificationLedColor(context);
String ledBlinkPattern = Prefs.getNotificationLedPattern(context);
String ledBlinkPatternCustom = Prefs.getNotificationLedPatternCustom(context);
@@ -89,6 +90,7 @@ abstract class AbstractNotificationBuilder extends NotificationCompat.Builder {
Integer.parseInt(blinkPatternArray[0]),
Integer.parseInt(blinkPatternArray[1]));
}
*/
}
void setTicker(@NonNull Recipient recipient, @Nullable CharSequence message) {
@@ -32,8 +32,6 @@ public class NotificationsPreferenceFragment extends ListSummaryPreferenceFragme
this.findPreference(Prefs.LED_COLOR_PREF)
.setOnPreferenceChangeListener(new ListSummaryListener());
this.findPreference(Prefs.LED_BLINK_PREF)
.setOnPreferenceChangeListener(new ListSummaryListener());
this.findPreference(Prefs.RINGTONE_PREF)
.setOnPreferenceChangeListener(new RingtoneSummaryListener());
this.findPreference(Prefs.NOTIFICATION_PRIVACY_PREF)
@@ -58,7 +56,6 @@ public class NotificationsPreferenceFragment extends ListSummaryPreferenceFragme
});
initializeListSummary((ListPreference) findPreference(Prefs.LED_COLOR_PREF));
initializeListSummary((ListPreference) findPreference(Prefs.LED_BLINK_PREF));
initializeListSummary((ListPreference) findPreference(Prefs.NOTIFICATION_PRIVACY_PREF));
initializeListSummary((ListPreference) findPreference(Prefs.NOTIFICATION_PRIORITY_PREF));
+1 -11
View File
@@ -42,9 +42,7 @@ public class Prefs {
private static final String CHAT_VIBRATE = "pref_chat_vibrate_"; // followed by chat-id
private static final String NOTIFICATION_PREF = "pref_key_enable_notifications";
public static final String LED_COLOR_PREF = "pref_led_color";
public static final String LED_BLINK_PREF = "pref_led_blink";
private static final String LED_BLINK_PREF_CUSTOM = "pref_led_blink_custom";
public static final String CHAT_MUTED_UNTIL = "pref_chat_muted_until_"; // followed by chat-id
public static final String CHAT_MUTED_UNTIL = "pref_chat_muted_until_"; // followed by chat-id
private static final String CHAT_RINGTONE = "pref_chat_ringtone_"; // followed by chat-id
public static final String SCREEN_LOCK_TIMEOUT_INTERVAL_PREF = "pref_timeout_interval";
public static final String SCREEN_LOCK_TIMEOUT_PREF = "pref_timeout_passphrase";
@@ -269,14 +267,6 @@ public class Prefs {
return getStringPreference(context, LED_COLOR_PREF, "blue");
}
public static String getNotificationLedPattern(Context context) {
return getStringPreference(context, LED_BLINK_PREF, "500,2000");
}
public static String getNotificationLedPatternCustom(Context context) {
return getStringPreference(context, LED_BLINK_PREF_CUSTOM, "500,2000");
}
// mute
public static void setChatMuteDuration(DcContext context, int chatId, long duration) {