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

Commit f143ca9f authored by Sungsoo Lim's avatar Sungsoo Lim Committed by android-build-merger
Browse files

Merge "Make RoutInfo.select() called in app's main thread" into oc-mr1-dev am: 6e326268

am: aee660bb

Change-Id: Idc830072c057861c9c6498d190a5b4aafaa3f1cb
parents b16c5e91 aee660bb
Loading
Loading
Loading
Loading
+14 −8
Original line number Diff line number Diff line
@@ -600,15 +600,21 @@ public class MediaRouter {

            @Override
            public void onRestoreRoute() {
                // Skip restoring route if the selected route is not a system audio route, or
                // MediaRouter is initializing.
                if ((mSelectedRoute != mDefaultAudioVideo && mSelectedRoute != mBluetoothA2dpRoute)
                        || mSelectedRoute == null) {
                mHandler.post(new Runnable() {
                    @Override
                    public void run() {
                        // Skip restoring route if the selected route is not a system audio route,
                        // MediaRouter is initializing, or mClient was changed.
                        if (Client.this != mClient || mSelectedRoute == null
                                || (mSelectedRoute != mDefaultAudioVideo
                                        && mSelectedRoute != mBluetoothA2dpRoute)) {
                            return;
                        }
                Log.v(TAG, "onRestoreRoute() : a2dp=" + isBluetoothA2dpOn());
                        Log.v(TAG, "onRestoreRoute() : route=" + mSelectedRoute);
                        mSelectedRoute.select();
                    }
                });
            }
        }
    }