Merge "MediaRouter: Route setBluetoothA2dpOn() via MediaRouterService" into sc-qpr1-dev
This commit is contained in:
@@ -39,6 +39,7 @@ interface IMediaRouterService {
|
|||||||
MediaRouterClientState getState(IMediaRouterClient client);
|
MediaRouterClientState getState(IMediaRouterClient client);
|
||||||
boolean isPlaybackActive(IMediaRouterClient client);
|
boolean isPlaybackActive(IMediaRouterClient client);
|
||||||
|
|
||||||
|
void setBluetoothA2dpOn(IMediaRouterClient client, boolean on);
|
||||||
void setDiscoveryRequest(IMediaRouterClient client, int routeTypes, boolean activeScan);
|
void setDiscoveryRequest(IMediaRouterClient client, int routeTypes, boolean activeScan);
|
||||||
void setSelectedRoute(IMediaRouterClient client, String routeId, boolean explicit);
|
void setSelectedRoute(IMediaRouterClient client, String routeId, boolean explicit);
|
||||||
void requestSetVolume(IMediaRouterClient client, String routeId, int volume);
|
void requestSetVolume(IMediaRouterClient client, String routeId, int volume);
|
||||||
|
|||||||
@@ -1070,7 +1070,8 @@ public class MediaRouter {
|
|||||||
&& (types & ROUTE_TYPE_LIVE_AUDIO) != 0
|
&& (types & ROUTE_TYPE_LIVE_AUDIO) != 0
|
||||||
&& (route.isBluetooth() || route.isDefault())) {
|
&& (route.isBluetooth() || route.isDefault())) {
|
||||||
try {
|
try {
|
||||||
sStatic.mAudioService.setBluetoothA2dpOn(route.isBluetooth());
|
sStatic.mMediaRouterService.setBluetoothA2dpOn(sStatic.mClient,
|
||||||
|
route.isBluetooth());
|
||||||
} catch (RemoteException e) {
|
} catch (RemoteException e) {
|
||||||
Log.e(TAG, "Error changing Bluetooth A2DP state", e);
|
Log.e(TAG, "Error changing Bluetooth A2DP state", e);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -336,6 +336,25 @@ public final class MediaRouterService extends IMediaRouterService.Stub
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Binder call
|
||||||
|
@Override
|
||||||
|
public void setBluetoothA2dpOn(IMediaRouterClient client, boolean on) {
|
||||||
|
if (client == null) {
|
||||||
|
throw new IllegalArgumentException("client must not be null");
|
||||||
|
}
|
||||||
|
|
||||||
|
final long token = Binder.clearCallingIdentity();
|
||||||
|
try {
|
||||||
|
synchronized (mLock) {
|
||||||
|
mAudioService.setBluetoothA2dpOn(on);
|
||||||
|
}
|
||||||
|
} catch (RemoteException ex) {
|
||||||
|
Slog.w(TAG, "RemoteException while calling setBluetoothA2dpOn. on=" + on);
|
||||||
|
} finally {
|
||||||
|
Binder.restoreCallingIdentity(token);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Binder call
|
// Binder call
|
||||||
@Override
|
@Override
|
||||||
public void setDiscoveryRequest(IMediaRouterClient client,
|
public void setDiscoveryRequest(IMediaRouterClient client,
|
||||||
|
|||||||
Reference in New Issue
Block a user