MediaRouter: Set initial mIsBluetoothA2dpOn value

When BT is connected before MediaRouter is initialized,
the mIsBluetoothA2dpOn is not set as true.

Since the value is false, the 'currentSystemRoute' variable in
MediaRouter.selectRouteStatic() is always default route.
This leads to skip selectRoute(defaultRoute) which is called by apps.

The value is always false and not renewed, until audio routes changed.
This results apps cannot make sounds through phone speaker.

The CL fixes the issue by correctly assigning the value when MediaRouter
is initialized.

Bug: 189176702
Test: GMM can make sound via phone speaker.
Change-Id: I4a83f9441a8b3165b7dd668aeef12c25fe3817c0
This commit is contained in:
Hyundo Moon
2021-06-03 16:24:34 +09:00
parent 076dfc8370
commit 2eedc1fe64

View File

@@ -185,6 +185,7 @@ public class MediaRouter {
AudioRoutesInfo newAudioRoutes = null;
try {
mIsBluetoothA2dpOn = mAudioService.isBluetoothA2dpOn();
newAudioRoutes = mAudioService.startWatchingRoutes(mAudioRoutesObserver);
} catch (RemoteException e) {
}