Skip to content

Commit

Permalink
Restore android call service
Browse files Browse the repository at this point in the history
  • Loading branch information
yostyle committed Nov 15, 2024
1 parent dc6c101 commit a55d180
Showing 1 changed file with 11 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -182,8 +182,11 @@ class CallAndroidService : VectorAndroidService() {
title = callInformation.opponentMatrixItem?.getBestName() ?: callInformation.opponentUserId,
fromBg = fromBg
)
// TCHAP fix crash when a call incoming on Androd 14 and higher
notificationManager.notify(callId.hashCode(), notification)
if (knownCalls.isEmpty()) {
startForegroundCompat(callId.hashCode(), notification)
} else {
notificationManager.notify(callId.hashCode(), notification)
}
knownCalls[callId] = callInformation
}

Expand All @@ -200,8 +203,7 @@ class CallAndroidService : VectorAndroidService() {
}
val notification = notificationUtils.buildCallEndedNotification(false)
val notificationId = callId.hashCode()
// TCHAP fix crash when a call incoming on Androd 14 and higher
notificationManager.notify(notificationId, notification)
startForegroundCompat(notificationId, notification)
if (knownCalls.isEmpty()) {
Timber.tag(loggerTag.value).v("No more call, stop the service")
stopForegroundCompat()
Expand Down Expand Up @@ -262,8 +264,11 @@ class CallAndroidService : VectorAndroidService() {
call = call,
title = callInformation.opponentMatrixItem?.getBestName() ?: callInformation.opponentUserId
)
// TCHAP fix crash when a call incoming on Androd 14 and higher
startForegroundCompat(callId.hashCode(), notification)
if (knownCalls.isEmpty()) {
startForegroundCompat(callId.hashCode(), notification)
} else {
notificationManager.notify(callId.hashCode(), notification)
}
knownCalls[callId] = callInformation
}

Expand Down

0 comments on commit a55d180

Please sign in to comment.