Skip to content

Jitsi Meet - Secure, Simple and Scalable Video Conferences that you use as a standalone app or embed in your web application.

feat(android) expose channels ids

tmoldovan8x8c7ad5b5b266f
diff --git a/android/sdk/src/main/java/org/jitsi/meet/sdk/NotificationChannels.java b/android/sdk/src/main/java/org/jitsi/meet/sdk/NotificationChannels.java
new file mode 100644
index 0000000000..1c1a9d150a
--- /dev/null
+++ b/android/sdk/src/main/java/org/jitsi/meet/sdk/NotificationChannels.java
@@ -0,0 +1,11 @@
+package org.jitsi.meet.sdk;
+
+import java.util.ArrayList;
+import java.util.List;
+
+public class NotificationChannels {
+ static final String ONGOING_CONFERENCE_CHANNEL_ID = "JitsiOngoingConferenceChannel";
+ static final String ONGOING_CONFERNCE_CHANNEL_NAME = "Ongoing Conference Notifications";
+
+ public static List<String> allIds = new ArrayList<String>() {{ add(ONGOING_CONFERENCE_CHANNEL_ID); }};
+}
diff --git a/android/sdk/src/main/java/org/jitsi/meet/sdk/OngoingNotification.java b/android/sdk/src/main/java/org/jitsi/meet/sdk/OngoingNotification.java
index eb7a81d20a..607d3af17e 100644
--- a/android/sdk/src/main/java/org/jitsi/meet/sdk/OngoingNotification.java
+++ b/android/sdk/src/main/java/org/jitsi/meet/sdk/OngoingNotification.java
@@ -16,6 +16,9 @@
package org.jitsi.meet.sdk;
+import static org.jitsi.meet.sdk.NotificationChannels.ONGOING_CONFERENCE_CHANNEL_ID;
+import static org.jitsi.meet.sdk.NotificationChannels.ONGOING_CONFERNCE_CHANNEL_NAME;
+
import android.app.Notification;
import android.app.NotificationChannel;
import android.app.NotificationManager;
@@ -39,9 +42,6 @@ import java.util.Random;
class OngoingNotification {
private static final String TAG = OngoingNotification.class.getSimpleName();
- private static final String CHANNEL_ID = "JitsiNotificationChannel";
- private static final String CHANNEL_NAME = "Ongoing Conference Notifications";
-
static final int NOTIFICATION_ID = new Random().nextInt(99999) + 10000;
private static long startingTime = 0;
@@ -60,13 +60,13 @@ class OngoingNotification {
= (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE);
NotificationChannel channel
- = notificationManager.getNotificationChannel(CHANNEL_ID);
+ = notificationManager.getNotificationChannel(ONGOING_CONFERENCE_CHANNEL_ID);
if (channel != null) {
// The channel was already created, no need to do it again.
return;
}
- channel = new NotificationChannel(CHANNEL_ID, CHANNEL_NAME, NotificationManager.IMPORTANCE_DEFAULT);
+ channel = new NotificationChannel(ONGOING_CONFERENCE_CHANNEL_ID, ONGOING_CONFERNCE_CHANNEL_NAME, NotificationManager.IMPORTANCE_DEFAULT);
channel.enableLights(false);
channel.enableVibration(false);
channel.setShowBadge(false);
@@ -84,7 +84,7 @@ class OngoingNotification {
Intent notificationIntent = new Intent(context, context.getClass());
PendingIntent pendingIntent = PendingIntent.getActivity(context, 0, notificationIntent, 0);
- NotificationCompat.Builder builder = new NotificationCompat.Builder(context, CHANNEL_ID);
+ NotificationCompat.Builder builder = new NotificationCompat.Builder(context, ONGOING_CONFERENCE_CHANNEL_ID);
if (startingTime == 0) {
startingTime = System.currentTimeMillis();