Resolve update system audio route NPE and foreground updates
With the recent addition of handling UPDATE_SYSTEM_AUDIO_ROUTE in the
new call audio routing path, there was a report of a NPE found due to
the CS being unbound during the system audio update. As a result, it
caused a NPE on IConnectionService.onCallEndpointChanged further down
the stack. We should ensure that these updates are done under the
telecom lock.
Following that, also ensure that the audio routing is adjusted to the
foreground call. Currently, CallAudioRouteController considers all
potential audio routes that the device supports but for individual
calls, this is determined via Call#getSupportedAudioRoutes(). We should
ensure that the ICS/CS are notified which routes are available and
adjust the current route based on what the foreground call supports.
When we're not in a call, we can fall back to using the device supported
routes.
Bug: 351977307
Test: atest CallAudioRouteControllerTest
Flag: com.android.server.telecom.flags.use_refactored_audio_route_switching
Change-Id: I5fdd630fb82469783f7d298e25ba3f73910fa2c7
2 files changed