Loading media/java/android/media/MediaRouter2Manager.java +12 −2 Original line number Diff line number Diff line Loading @@ -247,11 +247,21 @@ public class MediaRouter2Manager { Objects.requireNonNull(packageName, "packageName must not be null"); Objects.requireNonNull(route, "route must not be null"); boolean transferred = false; //TODO: instead of release all controllers, add an API to specify controllers that // should be released (or is the system controller). for (RoutingController controller : getRoutingControllers(packageName)) { if (controller.getSessionInfo().getTransferrableRoutes().contains(route.getId())) { if (!transferred && controller.getSessionInfo().getTransferrableRoutes() .contains(route.getId())) { controller.transferToRoute(route); return; transferred = true; } else if (!controller.getSessionInfo().isSystemSession()) { controller.release(); } } if (transferred) { return; } Client client; Loading services/core/java/com/android/server/media/MediaRoute2ProviderProxy.java +6 −0 Original line number Diff line number Diff line Loading @@ -411,6 +411,12 @@ final class MediaRoute2ProviderProxy extends MediaRoute2Provider implements Serv mActiveConnection.dispose(); mActiveConnection = null; setAndNotifyProviderState(null); synchronized (mLock) { for (RoutingSessionInfo sessionInfo : mSessionInfos) { mCallback.onSessionReleased(this, sessionInfo); } mSessionInfos.clear(); } } } Loading Loading
media/java/android/media/MediaRouter2Manager.java +12 −2 Original line number Diff line number Diff line Loading @@ -247,11 +247,21 @@ public class MediaRouter2Manager { Objects.requireNonNull(packageName, "packageName must not be null"); Objects.requireNonNull(route, "route must not be null"); boolean transferred = false; //TODO: instead of release all controllers, add an API to specify controllers that // should be released (or is the system controller). for (RoutingController controller : getRoutingControllers(packageName)) { if (controller.getSessionInfo().getTransferrableRoutes().contains(route.getId())) { if (!transferred && controller.getSessionInfo().getTransferrableRoutes() .contains(route.getId())) { controller.transferToRoute(route); return; transferred = true; } else if (!controller.getSessionInfo().isSystemSession()) { controller.release(); } } if (transferred) { return; } Client client; Loading
services/core/java/com/android/server/media/MediaRoute2ProviderProxy.java +6 −0 Original line number Diff line number Diff line Loading @@ -411,6 +411,12 @@ final class MediaRoute2ProviderProxy extends MediaRoute2Provider implements Serv mActiveConnection.dispose(); mActiveConnection = null; setAndNotifyProviderState(null); synchronized (mLock) { for (RoutingSessionInfo sessionInfo : mSessionInfos) { mCallback.onSessionReleased(this, sessionInfo); } mSessionInfos.clear(); } } } Loading