Update internal audio state before updating ICS.
In the case that an ICS is bound during a system audio update (for instance, when entering a new audio route), it's possible for that ICS to receive an incorrect audio state because the internal call audio state hasn't been updated yet. InCallController#onConnected will retrieve the current call audio state from CallAudioRouteStateMachine to send an audio update to the ICS. By updating the internal call audio state beforehand, we will ensure that the ICS receives the updated call state. This handles 3 different scenarios depending on when the ICS is bound: (1) ICS bound before internal audio update. (2) ICS bound after internal audio update and before system audio update (which sends audio update to ICS and CS). (3) ICS bound after system audio update. Bug: 335538831 Test: atest CallAudioRouteControllerTest (with flag enabled locally in setUp) Test: atest CallAudioRouteTransitionTests (with flag enabled locally in setUp) Change-Id: I610106f96a3d4283979fe8e682513e69dfb84fac
Loading
Please register or sign in to comment