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

Commit aee660bb 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

Change-Id: I91a4e5422a92f3e7571a1ffc7fb19d0594f116e2
parents 407b58ae 6e326268
Loading
Loading
Loading
Loading
+14 −8
Original line number Diff line number Diff line
@@ -598,15 +598,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();
                    }
                });
            }
        }
    }