|
|
|
@ -33,6 +33,7 @@ import androidx.localbroadcastmanager.content.LocalBroadcastManager; |
|
|
|
|
import org.jitsi.meet.sdk.log.JitsiMeetLogger; |
|
|
|
|
|
|
|
|
|
import java.util.HashMap; |
|
|
|
|
import java.util.Random; |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* This class implements an Android {@link Service}, a foreground one specifically, and it's |
|
|
|
@ -52,6 +53,9 @@ public class JitsiMeetOngoingConferenceService extends Service |
|
|
|
|
|
|
|
|
|
private boolean isAudioMuted; |
|
|
|
|
|
|
|
|
|
static final int NOTIFICATION_ID = new Random().nextInt(99999) + 10000; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public static void launch(Context context, HashMap<String, Object> extraData) { |
|
|
|
|
OngoingNotification.createOngoingConferenceNotificationChannel(); |
|
|
|
|
|
|
|
|
@ -96,9 +100,9 @@ public class JitsiMeetOngoingConferenceService extends Service |
|
|
|
|
JitsiMeetLogger.w(TAG + " Couldn't start service, notification is null"); |
|
|
|
|
} else { |
|
|
|
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) { |
|
|
|
|
startForeground(OngoingNotification.NOTIFICATION_ID, notification, ServiceInfo.FOREGROUND_SERVICE_TYPE_MEDIA_PLAYBACK); |
|
|
|
|
startForeground(NOTIFICATION_ID, notification, ServiceInfo.FOREGROUND_SERVICE_TYPE_MEDIA_PLAYBACK); |
|
|
|
|
} else { |
|
|
|
|
startForeground(OngoingNotification.NOTIFICATION_ID, notification); |
|
|
|
|
startForeground(NOTIFICATION_ID, notification); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -136,7 +140,7 @@ public class JitsiMeetOngoingConferenceService extends Service |
|
|
|
|
JitsiMeetLogger.w(TAG + " Couldn't start service, notification is null"); |
|
|
|
|
} else { |
|
|
|
|
NotificationManager notificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE); |
|
|
|
|
notificationManager.notify(OngoingNotification.NOTIFICATION_ID, notification); |
|
|
|
|
notificationManager.notify(NOTIFICATION_ID, notification); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -222,7 +226,7 @@ public class JitsiMeetOngoingConferenceService extends Service |
|
|
|
|
JitsiMeetLogger.w(TAG + " Couldn't update service, notification is null"); |
|
|
|
|
} else { |
|
|
|
|
NotificationManager notificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE); |
|
|
|
|
notificationManager.notify(OngoingNotification.NOTIFICATION_ID, notification); |
|
|
|
|
notificationManager.notify(NOTIFICATION_ID, notification); |
|
|
|
|
|
|
|
|
|
JitsiMeetLogger.i(TAG + " audio muted changed"); |
|
|
|
|
} |
|
|
|
|