mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-04-26 11:51:10 +01:00
Add per-contact notification channels.
Fixes #8119 Fixes #8121 Fixes #8122
This commit is contained in:
@@ -54,7 +54,7 @@ public class TextSecurePreferences {
|
||||
private static final String LAST_EXPERIENCE_VERSION_PREF = "last_experience_version_code";
|
||||
private static final String EXPERIENCE_DISMISSED_PREF = "experience_dismissed";
|
||||
public static final String RINGTONE_PREF = "pref_key_ringtone";
|
||||
private static final String VIBRATE_PREF = "pref_key_vibrate";
|
||||
public static final String VIBRATE_PREF = "pref_key_vibrate";
|
||||
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";
|
||||
@@ -159,6 +159,9 @@ public class TextSecurePreferences {
|
||||
private static final String LOG_ENCRYPTED_SECRET = "pref_log_encrypted_secret";
|
||||
private static final String LOG_UNENCRYPTED_SECRET = "pref_log_unencrypted_secret";
|
||||
|
||||
private static final String NOTIFICATION_CHANNEL_VERSION = "pref_notification_channel_version";
|
||||
private static final String NOTIFICATION_MESSAGES_CHANNEL_VERSION = "pref_notification_messages_channel_version";
|
||||
|
||||
public static boolean isScreenLockEnabled(@NonNull Context context) {
|
||||
return getBooleanPreference(context, SCREEN_LOCK, false);
|
||||
}
|
||||
@@ -960,6 +963,22 @@ public class TextSecurePreferences {
|
||||
return getStringPreference(context, LOG_UNENCRYPTED_SECRET, null);
|
||||
}
|
||||
|
||||
public static int getNotificationChannelVersion(Context context) {
|
||||
return getIntegerPreference(context, NOTIFICATION_CHANNEL_VERSION, 1);
|
||||
}
|
||||
|
||||
public static void setNotificationChannelVersion(Context context, int version) {
|
||||
setIntegerPrefrence(context, NOTIFICATION_CHANNEL_VERSION, version);
|
||||
}
|
||||
|
||||
public static int getNotificationMessagesChannelVersion(Context context) {
|
||||
return getIntegerPreference(context, NOTIFICATION_MESSAGES_CHANNEL_VERSION, 1);
|
||||
}
|
||||
|
||||
public static void setNotificationMessagesChannelVersion(Context context, int version) {
|
||||
setIntegerPrefrence(context, NOTIFICATION_MESSAGES_CHANNEL_VERSION, version);
|
||||
}
|
||||
|
||||
public static void setBooleanPreference(Context context, String key, boolean value) {
|
||||
PreferenceManager.getDefaultSharedPreferences(context).edit().putBoolean(key, value).apply();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user