Merge "Make RoutInfo.select() called in app's main thread" into oc-mr1-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
6e326268c1
@@ -598,14 +598,20 @@ 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) {
|
||||
return;
|
||||
}
|
||||
Log.v(TAG, "onRestoreRoute() : a2dp=" + isBluetoothA2dpOn());
|
||||
mSelectedRoute.select();
|
||||
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() : route=" + mSelectedRoute);
|
||||
mSelectedRoute.select();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user