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

Commit 6e326268 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

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

parents 20e1c66a 133a24e0
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();
                    }
                });
            }
        }
    }