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

Unverified Commit 91e0f735 authored by Weijie Wang's avatar Weijie Wang Committed by Michael Bestas
Browse files

SystemUI: Check whether the selected WFD route is available

When the selected WFD route is not available, the cast tile in
quick settings and the cast slot in the status bar are both shown
as a connected icon, it is not reasonable. This CL checks whether
the selected route is available when getting the cast devices.

Bug: 247925238
Test: Mannual
Change-Id: Ifdbf4c61e95504ae7fc24933695e6fd348d75750
parent 1c2c9112
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -89,7 +89,8 @@ public abstract class MediaRouteDialogPresenter {
        final MediaRouter router = context.getSystemService(MediaRouter.class);

        MediaRouter.RouteInfo route = router.getSelectedRoute();
        if (route.isDefault() || !route.matchesTypes(routeTypes)) {
        if (route.isDefault() || !route.matchesTypes(routeTypes)
                || route.getStatusCode() == MediaRouter.RouteInfo.STATUS_NOT_AVAILABLE) {
            final MediaRouteChooserDialog d = new MediaRouteChooserDialog(context, theme,
                    showProgressBarWhenEmpty);
            d.setRouteTypes(routeTypes);
+2 −1
Original line number Diff line number Diff line
@@ -167,7 +167,8 @@ public class CastControllerImpl implements CastController {
                int statusCode = route.getStatusCode();
                if (statusCode == RouteInfo.STATUS_CONNECTING) {
                    device.state = CastDevice.STATE_CONNECTING;
                } else if (route.isSelected() || statusCode == RouteInfo.STATUS_CONNECTED) {
                } else if (route.isSelected() && statusCode != RouteInfo.STATUS_NOT_AVAILABLE
                        || statusCode == RouteInfo.STATUS_CONNECTED) {
                    device.state = CastDevice.STATE_CONNECTED;
                } else {
                    device.state = CastDevice.STATE_DISCONNECTED;