Handle Telecom presentation and pending caller choice notifications

This commit is contained in:
evgeny committed 2026-10-19 15:20:25 +02:00
1 parent bd2dd056d6
commit 187fc7fee8
3 files changed
+4 -1

No files matched your search

@@ -185,6 +185,7 @@ class CallService : Service() {
.setContentText(when (st?.phase) {
CallPhase.ACTIVE -> AppLanguage.text(R.string.call_talking)
CallPhase.RINGING -> AppLanguage.text(R.string.call_ringing)
CallPhase.WAIT_DECISION -> AppLanguage.text(R.string.phone_busy_warning)
else -> AppLanguage.text(R.string.call_setup)
})
.setCategory(NotificationCompat.CATEGORY_CALL)
@@ -65,6 +65,7 @@ class UtunConnection(
override fun onDisconnect() = TelecomCallManager.notifyDisconnect(callId)
override fun onAbort() = TelecomCallManager.notifyAbort(callId)
override fun onShowIncomingCallUi() = TelecomCallManager.notifyIncomingUiAllowed(callId)
override fun onStateChanged(state: Int) {
LogManager.addLog("DEBUG", "UtunConn", "state -> %s".format(Connection.stateToString(state)))
@@ -41,12 +41,13 @@ fun ActiveCallBanner(
) {
val st = viewModel.callState.collectAsState().value ?: return
val phase = st.phase
if (phase != CallPhase.OUTGOING && phase != CallPhase.RINGING && phase != CallPhase.ACTIVE) return
if (phase != CallPhase.OUTGOING && phase != CallPhase.RINGING && phase != CallPhase.ACTIVE && phase != CallPhase.WAIT_DECISION) return
val name = st.peerName.ifEmpty { "0x%016x".format(st.peerNodeId) }
val status = when (phase) {
CallPhase.ACTIVE -> stringResource(R.string.call_talking_prefix) + fmtDuration(st.durationSeconds)
CallPhase.RINGING -> stringResource(R.string.call_ringing)
CallPhase.WAIT_DECISION -> stringResource(R.string.phone_busy_warning)
else -> stringResource(R.string.call_connecting)
}