Update app/src/main/java/org/thoughtcrime/securesms/service/WebRtcCallService.kt

Co-authored-by: Andrew <andrewgallasch@gmail.com>
This commit is contained in:
ThomasSession 2024-08-02 08:44:39 +10:00 committed by GitHub
parent 7dcfba4932
commit e71f650dc0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -730,11 +730,7 @@ class WebRtcCallService : LifecycleService(), CallManager.WebRtcListener {
this, this,
CallNotificationBuilder.WEBRTC_NOTIFICATION, CallNotificationBuilder.WEBRTC_NOTIFICATION,
CallNotificationBuilder.getCallInProgressNotification(this, type, recipient), CallNotificationBuilder.getCallInProgressNotification(this, type, recipient),
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) { if (Build.VERSION.SDK_INT >= 30) ServiceInfo.FOREGROUND_SERVICE_TYPE_MICROPHONE else 0
ServiceInfo.FOREGROUND_SERVICE_TYPE_MICROPHONE
} else {
0
}
) )
} catch (e: IllegalStateException) { } catch (e: IllegalStateException) {
Log.e(TAG, "Failed to setCallInProgressNotification as a foreground service for type: ${type}, trying to update instead", e) Log.e(TAG, "Failed to setCallInProgressNotification as a foreground service for type: ${type}, trying to update instead", e)