Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5a9ab8d6 authored by Hyundo Moon's avatar Hyundo Moon Committed by Automerger Merge Worker
Browse files

Merge "MediaRouter: Route setBluetoothA2dpOn() via MediaRouterService" into...

Merge "MediaRouter: Route setBluetoothA2dpOn() via MediaRouterService" into sc-qpr1-dev am: 2c7ec2cb

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/16044773

Change-Id: I017be1b10677f78ee7f5b290a13eab376c4e0615
parents a18b8a82 2c7ec2cb
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -39,6 +39,7 @@ interface IMediaRouterService {
    MediaRouterClientState getState(IMediaRouterClient client);
    boolean isPlaybackActive(IMediaRouterClient client);

    void setBluetoothA2dpOn(IMediaRouterClient client, boolean on);
    void setDiscoveryRequest(IMediaRouterClient client, int routeTypes, boolean activeScan);
    void setSelectedRoute(IMediaRouterClient client, String routeId, boolean explicit);
    void requestSetVolume(IMediaRouterClient client, String routeId, int volume);
+2 −1
Original line number Diff line number Diff line
@@ -1087,7 +1087,8 @@ public class MediaRouter {
                && (types & ROUTE_TYPE_LIVE_AUDIO) != 0
                && (route.isBluetooth() || route.isDefault())) {
            try {
                sStatic.mAudioService.setBluetoothA2dpOn(route.isBluetooth());
                sStatic.mMediaRouterService.setBluetoothA2dpOn(sStatic.mClient,
                        route.isBluetooth());
            } catch (RemoteException e) {
                Log.e(TAG, "Error changing Bluetooth A2DP state", e);
            }
+19 −0
Original line number Diff line number Diff line
@@ -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
    @Override
    public void setDiscoveryRequest(IMediaRouterClient client,