Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit ed542ea4 authored by Tyler Gunn's avatar Tyler Gunn
Browse files

Suppress state changes in CallAudioManager when state doesn't change.

A fix was made for b/155109531 which to ensure that the disconnecting
state gets communicated to Dialer upon local disconnect initiation.
Due to... reasons.. the DISCONNECTING state is not a proper top level
state in a Call.  It is only sent when parcelling the call info to an
InCallService and otherwise is reflected in Call.isLocallyDisconnecting().

In any case, as a consequence of that change, CallAudioManager was now
getting notificed of a state change from oldState = DIALING to
newState = DIALING (since its locally disconnecting).

CallAudioManager ultimately DOES NOT care about the disconnecting state
and only really cares about top level state changes.  However, the way
this logic was structured we first remove the call from all the bins it
is in, and then re-add it to the new bin.  But we're not actually moving
it out of its current bin since oldState == newState.

As a consequence we'd end up triggering CallaudioModeStateMachine
NEW_ACTIVE_OR_DIALING_CALL, and also stopping and re-starting the
ringback tone, which really we don't want to do.

Also, I saw a little incongruity in the CAllScreeningServiceHelper logs
which meant we were not emitting a log message when we should have, so
fixing that too.

Fixes: 229938369
Test: Manual test on ATT to verify local ringback starts and stops as it
should.
Test: Added unit test to verify that we are not starting and stopping the
tone multiple times.

Change-Id: I21b95f9137fb4dd1da78e4a21fad9e7ea33164e0
parent 026d702d
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment