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

Commit 352bc74d authored by Hyundo Moon's avatar Hyundo Moon
Browse files

Fix deadlock in MediaRouterService

The deadlock was introduced by the previously merged CL
"2942e4b5: MediaRouter: Route setBluetoothA2dpOn() 
  via MediaRouterService".

Bug: 181962322, Bug: 206160544
Change-Id: I3936b8345e8df20a51400a9083d46872e6801568
Test: Builds successfully
parent e25bce2d
Loading
Loading
Loading
Loading
+2 −3
Original line number Diff line number Diff line
@@ -100,6 +100,7 @@ public final class MediaRouterService extends IMediaRouterService.Stub

    // State guarded by mLock.
    private final Object mLock = new Object();

    private final SparseArray<UserRecord> mUserRecords = new SparseArray<>();
    private final ArrayMap<IBinder, ClientRecord> mAllClientRecords = new ArrayMap<>();
    private int mCurrentUserId = -1;
@@ -345,9 +346,7 @@ public final class MediaRouterService extends IMediaRouterService.Stub

        final long token = Binder.clearCallingIdentity();
        try {
            synchronized (mLock) {
            mAudioService.setBluetoothA2dpOn(on);
            }
        } catch (RemoteException ex) {
            Slog.w(TAG, "RemoteException while calling setBluetoothA2dpOn. on=" + on);
        } finally {