Reduce use of clearCommunicationDevice.
We can reduce the use of clearCommunicationDevice so that it is only called at the end of a call. When switching routes mid-call, there is no need to call it. To fix this, we pass the destination audio route's active/inactive status into `setOrigRoute` and update the `PendingAudioRoute` with that. When `AudioRoute#clearCommunicationDevice` is called, we'll now only clear if we are transitioning to an inactive state. Flag: com.android.server.telecom.flags.only_clear_communication_device_on_inactive Fixes: 376781369 Test: Run Telecom unit tests. Test: Swap between earpiece/speaker, disconnect call. Test: Swap between earpiece/speaker/SCO, disconnect call. Test: Swap between earpiece/speaker/LE, disconnect call. Change-Id: Ibc444784d96d9bf99700ba52cf321fcdcbfc2ea0
Loading
Please register or sign in to comment