Repository navigation
fix(android): keep a new call dialing or ringing - #913
Merged
Merged
Conversation
onCreateOutgoingConnection called setInitialized() after setDialing(), and onCreateIncomingConnection after setRinging(). setInitialized() sets STATE_NEW, which ConnectionService doesn't forward to Telecom: Telecom showed the call dialing or ringing while the connection's own state, read with VoiceConnectionService.getConnection(uuid).getState(), was STATE_NEW. The calls are removed: createConnection() leaves the connection initializing, and setDialing() or setRinging() moves it on. Samsung devices already skipped the outgoing call's setInitialized(), so they are unchanged for outgoing calls. CallKeepConnectionStateTest checks both states, in managed and self-managed mode.
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
onCreateOutgoingConnectioncalledsetInitialized()aftersetDialing(), andonCreateIncomingConnectionaftersetRinging().setInitialized()setsSTATE_NEW, whichConnectionServicedoesn't forward to Telecom: Telecom showed the call dialing or ringing, while the connection's own state, read withVoiceConnectionService.getConnection(uuid).getState(), wasSTATE_NEW(1).The calls come from 32b7fe5 (2019), which moved
setInitialized()from the end ofcreateConnection()to aftersetDialing()andsetRinging(). Since 3ad5345, Samsung devices skip it for outgoing calls, where it kept the native UI from showing.Fix
Remove both calls.
createConnection()leaves the connection initializing, andsetDialing()orsetRinging()moves it on. Every device now does what Samsung devices already did for outgoing calls.Moving
setInitialized()beforesetDialing()would change nothing visible: Telecom doesn't listen to the connection until it is returned, so it would see the same state, behind a Samsung check that no longer does anything.Tests
tests/android/CallKeepConnectionStateTest.kt(instrumentation, real Telecom) places an outgoing and an incoming call, in managed and self-managed mode. It waits for Telecom to show the call dialing or ringing (dumpsys telecom), then checks the connection's state, then makes the call active.expected:<3> but was:<1>(outgoing),expected:<2> but was:<1>(incoming)setInitialized()On master, every failure comes after the Telecom check passed: Telecom showed the call dialing or ringing while the connection said
STATE_NEW.