From bc1c4d26ecfd9b33b79cbdf1e200ac790188e996 Mon Sep 17 00:00:00 2001 From: Scott Jackson Date: Mon, 10 Mar 2014 15:51:42 -0700 Subject: #306 Fix timeout not updating MediaRouter info --- src/github/daneren2005/dsub/service/DownloadService.java | 4 ++++ src/github/daneren2005/dsub/util/MediaRouteManager.java | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/src/github/daneren2005/dsub/service/DownloadService.java b/src/github/daneren2005/dsub/service/DownloadService.java index e31075ac..eda0fc55 100644 --- a/src/github/daneren2005/dsub/service/DownloadService.java +++ b/src/github/daneren2005/dsub/service/DownloadService.java @@ -1120,6 +1120,10 @@ public class DownloadService extends Service { setPlayerState(PlayerState.IDLE); remoteController.shutdown(); remoteController = null; + + if(newState == RemoteCtronlState.LOCAL) { + mediaRouter.setDefaultRoute(); + } } remoteState = newState; diff --git a/src/github/daneren2005/dsub/util/MediaRouteManager.java b/src/github/daneren2005/dsub/util/MediaRouteManager.java index d41a5516..95cded67 100644 --- a/src/github/daneren2005/dsub/util/MediaRouteManager.java +++ b/src/github/daneren2005/dsub/util/MediaRouteManager.java @@ -80,6 +80,10 @@ public class MediaRouteManager extends MediaRouter.Callback { downloadService.setRemoteEnabled(RemoteControlState.LOCAL); } + public void setDefaultRoute() { + router.selectRoute(router.getDefaultRoute()); + } + public void startScan() { router.addCallback(selector, this, MediaRouter.CALLBACK_FLAG_PERFORM_ACTIVE_SCAN); } -- cgit v1.2.3