Loading media/java/android/media/MediaRouter.java +7 −5 Original line number Original line Diff line number Diff line Loading @@ -704,7 +704,8 @@ public class MediaRouter { final WifiDisplay d = newDisplays[i]; final WifiDisplay d = newDisplays[i]; final WifiDisplay oldRemembered = findMatchingDisplay(d, oldDisplays); final WifiDisplay oldRemembered = findMatchingDisplay(d, oldDisplays); if (oldRemembered == null) { if (oldRemembered == null) { addRouteStatic(makeWifiDisplayRoute(d)); addRouteStatic(makeWifiDisplayRoute(d, findMatchingDisplay(d, availableDisplays) != null)); needScan = true; needScan = true; } else { } else { final boolean available = findMatchingDisplay(d, availableDisplays) != null; final boolean available = findMatchingDisplay(d, availableDisplays) != null; Loading Loading @@ -733,15 +734,16 @@ public class MediaRouter { sStatic.mLastKnownWifiDisplayStatus = newStatus; sStatic.mLastKnownWifiDisplayStatus = newStatus; } } static RouteInfo makeWifiDisplayRoute(WifiDisplay display) { static RouteInfo makeWifiDisplayRoute(WifiDisplay display, boolean available) { final RouteInfo newRoute = new RouteInfo(sStatic.mSystemCategory); final RouteInfo newRoute = new RouteInfo(sStatic.mSystemCategory); newRoute.mDeviceAddress = display.getDeviceAddress(); newRoute.mDeviceAddress = display.getDeviceAddress(); newRoute.mSupportedTypes = ROUTE_TYPE_LIVE_AUDIO | ROUTE_TYPE_LIVE_VIDEO; newRoute.mSupportedTypes = ROUTE_TYPE_LIVE_AUDIO | ROUTE_TYPE_LIVE_VIDEO; newRoute.mVolumeHandling = RouteInfo.PLAYBACK_VOLUME_FIXED; newRoute.mVolumeHandling = RouteInfo.PLAYBACK_VOLUME_FIXED; newRoute.mPlaybackType = RouteInfo.PLAYBACK_TYPE_REMOTE; newRoute.mPlaybackType = RouteInfo.PLAYBACK_TYPE_REMOTE; newRoute.mStatus = sStatic.mResources.getText( com.android.internal.R.string.media_route_status_connecting); newRoute.setStatusCode(available ? newRoute.mEnabled = false; RouteInfo.STATUS_AVAILABLE : RouteInfo.STATUS_CONNECTING); newRoute.mEnabled = available; newRoute.mName = makeWifiDisplayName(display); newRoute.mName = makeWifiDisplayName(display); return newRoute; return newRoute; Loading Loading
media/java/android/media/MediaRouter.java +7 −5 Original line number Original line Diff line number Diff line Loading @@ -704,7 +704,8 @@ public class MediaRouter { final WifiDisplay d = newDisplays[i]; final WifiDisplay d = newDisplays[i]; final WifiDisplay oldRemembered = findMatchingDisplay(d, oldDisplays); final WifiDisplay oldRemembered = findMatchingDisplay(d, oldDisplays); if (oldRemembered == null) { if (oldRemembered == null) { addRouteStatic(makeWifiDisplayRoute(d)); addRouteStatic(makeWifiDisplayRoute(d, findMatchingDisplay(d, availableDisplays) != null)); needScan = true; needScan = true; } else { } else { final boolean available = findMatchingDisplay(d, availableDisplays) != null; final boolean available = findMatchingDisplay(d, availableDisplays) != null; Loading Loading @@ -733,15 +734,16 @@ public class MediaRouter { sStatic.mLastKnownWifiDisplayStatus = newStatus; sStatic.mLastKnownWifiDisplayStatus = newStatus; } } static RouteInfo makeWifiDisplayRoute(WifiDisplay display) { static RouteInfo makeWifiDisplayRoute(WifiDisplay display, boolean available) { final RouteInfo newRoute = new RouteInfo(sStatic.mSystemCategory); final RouteInfo newRoute = new RouteInfo(sStatic.mSystemCategory); newRoute.mDeviceAddress = display.getDeviceAddress(); newRoute.mDeviceAddress = display.getDeviceAddress(); newRoute.mSupportedTypes = ROUTE_TYPE_LIVE_AUDIO | ROUTE_TYPE_LIVE_VIDEO; newRoute.mSupportedTypes = ROUTE_TYPE_LIVE_AUDIO | ROUTE_TYPE_LIVE_VIDEO; newRoute.mVolumeHandling = RouteInfo.PLAYBACK_VOLUME_FIXED; newRoute.mVolumeHandling = RouteInfo.PLAYBACK_VOLUME_FIXED; newRoute.mPlaybackType = RouteInfo.PLAYBACK_TYPE_REMOTE; newRoute.mPlaybackType = RouteInfo.PLAYBACK_TYPE_REMOTE; newRoute.mStatus = sStatic.mResources.getText( com.android.internal.R.string.media_route_status_connecting); newRoute.setStatusCode(available ? newRoute.mEnabled = false; RouteInfo.STATUS_AVAILABLE : RouteInfo.STATUS_CONNECTING); newRoute.mEnabled = available; newRoute.mName = makeWifiDisplayName(display); newRoute.mName = makeWifiDisplayName(display); return newRoute; return newRoute; Loading