Wear SIP: stop handing incoming calls to system telecom (fixes 2s drop)

The experiment of calling TelecomManager.addNewIncomingCall() for our
COMPANION PhoneAccount caused Samsung Wear's telecom stack to auto-reject
the incoming WearConnection within ~2s; its onReject() then hung up the
native baresip call, so Asterisk dropped to voicemail immediately instead
of ringing for the configured 25s.

Remove the handoff from the 'call incoming' path. The in-app InCallScreen
+ full-screen-intent notification remain the alert UI. The native call now
stays alive and rings for the full window (verified: no more 2s reject +
re-register cycle).
This commit is contained in:
2026-08-20 23:12:23 +01:00
parent c88bee33d8
commit 34661f4ca6

View File

@ -230,13 +230,14 @@ class WearBaresipService : Service() {
CallState.status.value = "Incoming call"
// Surface the incoming-call UI even if the app was backgrounded,
// and alert the wearer (the watch screen is usually dimmed).
// NOTE: we deliberately do NOT hand the call to the system
// telecom stack. On Samsung Wear the third-party COMPANION
// PhoneAccount is auto-rejected within ~2s, and that rejection
// propagated back to the native baresip call (hangup) — which
// made Asterisk drop to voicemail immediately instead of ringing
// for the configured 25s. The in-app InCallScreen + the
// full-screen-intent notification below are the real alert UI.
alertIncomingCall(peer)
// Experiment: also hand the call to the system telecom stack so
// the stock Wear incoming UI can be used if the dialer honors
// our PhoneAccount. The in-app InCallScreen is shown regardless.
try { TelecomHelper.addIncomingCall(this, cp, uap, peer) } catch (e: Exception) {
Log.w("Baresip Wear", "telecom addIncomingCall failed: ${e.message}")
}
}
ev == "call outgoing" -> CallState.status.value = "Calling"
ev == "call established" -> {