Files
arcanechat-android/src/org/thoughtcrime/securesms/notifications/MessageNotifierCompat.java
T
cyBerta 451ea1dbad Don't use notification's / notification channel's sound and vibration functionality at all.
Instead we're handling sound and vibration alerts separately. It allows us to dynamically
change the 'signal' flag  turning on and off sounds on Android O+ without posting into different
channels for loud and silent notifications. This way we keep the grouped notification view
instead of falling back to the pre API 23 summary notificatoin view.
2019-05-29 12:07:37 +02:00

53 lines
1.3 KiB
Java

package org.thoughtcrime.securesms.notifications;
import android.content.Context;
import android.os.Build;
public class MessageNotifierCompat {
public static final int NO_VISIBLE_CHAT_ID = -1;
static final int SUMMARY_NOTIFICATION_ID = 1338;
static final String EXTRA_REMOTE_REPLY = "extra_remote_reply";
private static IMessageNotifier instance;
public static void init(Context context) {
if (instance != null) {
return;
}
if (Build.VERSION.SDK_INT < 23) {
instance = new MessageNotifierPreApi23(context);
} else {
instance = new MessageNotifierApi23(context);
}
}
public static void playSendSound() {
instance.playSendSound();
}
public static void updateNotification(int chatId, int messageId) {
instance.updateNotification(chatId, messageId);
}
public static void updateVisibleChat(int chatId) {
instance.updateVisibleChat(chatId);
}
public static void onNotificationPrivacyChanged() {
instance.onNotificationPrivacyChanged();
}
static void removeNotifications(int[] chatIds) {
instance.removeNotifications(chatIds);
}
static void removeNotifications(int chatId) {
instance.removeNotifications(chatId);
}
}