Merge "Call MediaRouter2Manager#onTransferred" into rvc-dev am: bd67f0ad34 am: a28daa0022 am: 1699b0c560
Change-Id: I9be268a4f4771b9536c453f85369e6c7a2a61108
This commit is contained in:
@@ -24,8 +24,8 @@ import android.media.RoutingSessionInfo;
|
|||||||
* {@hide}
|
* {@hide}
|
||||||
*/
|
*/
|
||||||
oneway interface IMediaRouter2Manager {
|
oneway interface IMediaRouter2Manager {
|
||||||
void notifySessionCreated(in RoutingSessionInfo sessionInfo);
|
void notifySessionCreated(int requestId, in RoutingSessionInfo sessionInfo);
|
||||||
void notifySessionsUpdated();
|
void notifySessionUpdated(in RoutingSessionInfo sessionInfo);
|
||||||
void notifyPreferredFeaturesChanged(String packageName, in List<String> preferredFeatures);
|
void notifyPreferredFeaturesChanged(String packageName, in List<String> preferredFeatures);
|
||||||
void notifyRoutesAdded(in List<MediaRoute2Info> routes);
|
void notifyRoutesAdded(in List<MediaRoute2Info> routes);
|
||||||
void notifyRoutesRemoved(in List<MediaRoute2Info> routes);
|
void notifyRoutesRemoved(in List<MediaRoute2Info> routes);
|
||||||
|
|||||||
@@ -75,6 +75,8 @@ public final class MediaRouter2Manager {
|
|||||||
final ConcurrentMap<String, List<String>> mPreferredFeaturesMap = new ConcurrentHashMap<>();
|
final ConcurrentMap<String, List<String>> mPreferredFeaturesMap = new ConcurrentHashMap<>();
|
||||||
|
|
||||||
private final AtomicInteger mNextRequestId = new AtomicInteger(1);
|
private final AtomicInteger mNextRequestId = new AtomicInteger(1);
|
||||||
|
private final CopyOnWriteArrayList<TransferRequest> mTransferRequests =
|
||||||
|
new CopyOnWriteArrayList<>();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets an instance of media router manager that controls media route of other applications.
|
* Gets an instance of media router manager that controls media route of other applications.
|
||||||
@@ -328,6 +330,9 @@ public final class MediaRouter2Manager {
|
|||||||
if (client != null) {
|
if (client != null) {
|
||||||
try {
|
try {
|
||||||
int requestId = mNextRequestId.getAndIncrement();
|
int requestId = mNextRequestId.getAndIncrement();
|
||||||
|
//TODO: Ensure that every request is eventually removed.
|
||||||
|
mTransferRequests.add(new TransferRequest(requestId, sessionInfo, route));
|
||||||
|
|
||||||
mMediaRouterService.requestCreateSessionWithManager(
|
mMediaRouterService.requestCreateSessionWithManager(
|
||||||
client, requestId, sessionInfo.getClientPackageName(), route);
|
client, requestId, sessionInfo.getClientPackageName(), route);
|
||||||
} catch (RemoteException ex) {
|
} catch (RemoteException ex) {
|
||||||
@@ -446,6 +451,77 @@ public final class MediaRouter2Manager {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void createSessionOnHandler(int requestId, RoutingSessionInfo sessionInfo) {
|
||||||
|
TransferRequest matchingRequest = null;
|
||||||
|
for (TransferRequest request : mTransferRequests) {
|
||||||
|
if (request.mRequestId == requestId) {
|
||||||
|
matchingRequest = request;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (matchingRequest == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
mTransferRequests.remove(matchingRequest);
|
||||||
|
|
||||||
|
MediaRoute2Info requestedRoute = matchingRequest.mTargetRoute;
|
||||||
|
|
||||||
|
if (sessionInfo == null) {
|
||||||
|
notifyTransferFailed(matchingRequest.mOldSessionInfo, requestedRoute);
|
||||||
|
return;
|
||||||
|
} else if (!sessionInfo.getSelectedRoutes().contains(requestedRoute.getId())) {
|
||||||
|
Log.w(TAG, "The session does not contain the requested route. "
|
||||||
|
+ "(requestedRouteId=" + requestedRoute.getId()
|
||||||
|
+ ", actualRoutes=" + sessionInfo.getSelectedRoutes()
|
||||||
|
+ ")");
|
||||||
|
notifyTransferFailed(matchingRequest.mOldSessionInfo, requestedRoute);
|
||||||
|
return;
|
||||||
|
} else if (!TextUtils.equals(requestedRoute.getProviderId(),
|
||||||
|
sessionInfo.getProviderId())) {
|
||||||
|
Log.w(TAG, "The session's provider ID does not match the requested route's. "
|
||||||
|
+ "(requested route's providerId=" + requestedRoute.getProviderId()
|
||||||
|
+ ", actual providerId=" + sessionInfo.getProviderId()
|
||||||
|
+ ")");
|
||||||
|
notifyTransferFailed(matchingRequest.mOldSessionInfo, requestedRoute);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
notifyTransferred(matchingRequest.mOldSessionInfo, sessionInfo);
|
||||||
|
}
|
||||||
|
|
||||||
|
void handleFailureOnHandler(int requestId, int reason) {
|
||||||
|
TransferRequest matchingRequest = null;
|
||||||
|
for (TransferRequest request : mTransferRequests) {
|
||||||
|
if (request.mRequestId == requestId) {
|
||||||
|
matchingRequest = request;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (matchingRequest != null) {
|
||||||
|
mTransferRequests.remove(matchingRequest);
|
||||||
|
notifyTransferFailed(matchingRequest.mOldSessionInfo, matchingRequest.mTargetRoute);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
notifyRequestFailed(reason);
|
||||||
|
}
|
||||||
|
|
||||||
|
void handleSessionsUpdated(RoutingSessionInfo sessionInfo) {
|
||||||
|
for (TransferRequest request : mTransferRequests) {
|
||||||
|
String sessionId = request.mOldSessionInfo.getId();
|
||||||
|
if (!TextUtils.equals(sessionId, sessionInfo.getId())) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if (sessionInfo.getSelectedRoutes().contains(request.mTargetRoute.getId())) {
|
||||||
|
notifyTransferred(request.mOldSessionInfo, sessionInfo);
|
||||||
|
mTransferRequests.remove(request);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
notifySessionUpdated(sessionInfo);
|
||||||
|
}
|
||||||
|
|
||||||
private void notifyRoutesAdded(List<MediaRoute2Info> routes) {
|
private void notifyRoutesAdded(List<MediaRoute2Info> routes) {
|
||||||
for (CallbackRecord record: mCallbackRecords) {
|
for (CallbackRecord record: mCallbackRecords) {
|
||||||
record.mExecutor.execute(
|
record.mExecutor.execute(
|
||||||
@@ -467,16 +543,9 @@ public final class MediaRouter2Manager {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void notifySessionCreated(RoutingSessionInfo sessionInfo) {
|
void notifySessionUpdated(RoutingSessionInfo sessionInfo) {
|
||||||
for (CallbackRecord record : mCallbackRecords) {
|
for (CallbackRecord record : mCallbackRecords) {
|
||||||
record.mExecutor.execute(() -> record.mCallback.onSessionCreated(
|
record.mExecutor.execute(() -> record.mCallback.onSessionUpdated(sessionInfo));
|
||||||
new RoutingController(sessionInfo)));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void notifySessionInfosChanged() {
|
|
||||||
for (CallbackRecord record : mCallbackRecords) {
|
|
||||||
record.mExecutor.execute(() -> record.mCallback.onSessionsUpdated());
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -569,7 +638,7 @@ public final class MediaRouter2Manager {
|
|||||||
*
|
*
|
||||||
* @see #getSelectedRoutes(RoutingSessionInfo)
|
* @see #getSelectedRoutes(RoutingSessionInfo)
|
||||||
* @see #getSelectableRoutes(RoutingSessionInfo)
|
* @see #getSelectableRoutes(RoutingSessionInfo)
|
||||||
* @see Callback#onSessionsUpdated()
|
* @see Callback#onSessionUpdated(RoutingSessionInfo)
|
||||||
*/
|
*/
|
||||||
public void selectRoute(@NonNull RoutingSessionInfo sessionInfo,
|
public void selectRoute(@NonNull RoutingSessionInfo sessionInfo,
|
||||||
@NonNull MediaRoute2Info route) {
|
@NonNull MediaRoute2Info route) {
|
||||||
@@ -614,7 +683,7 @@ public final class MediaRouter2Manager {
|
|||||||
*
|
*
|
||||||
* @see #getSelectedRoutes(RoutingSessionInfo)
|
* @see #getSelectedRoutes(RoutingSessionInfo)
|
||||||
* @see #getDeselectableRoutes(RoutingSessionInfo)
|
* @see #getDeselectableRoutes(RoutingSessionInfo)
|
||||||
* @see Callback#onSessionsUpdated()
|
* @see Callback#onSessionUpdated(RoutingSessionInfo)
|
||||||
*/
|
*/
|
||||||
public void deselectRoute(@NonNull RoutingSessionInfo sessionInfo,
|
public void deselectRoute(@NonNull RoutingSessionInfo sessionInfo,
|
||||||
@NonNull MediaRoute2Info route) {
|
@NonNull MediaRoute2Info route) {
|
||||||
@@ -667,13 +736,15 @@ public final class MediaRouter2Manager {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int requestId = mNextRequestId.getAndIncrement();
|
||||||
|
mTransferRequests.add(new TransferRequest(requestId, sessionInfo, route));
|
||||||
|
|
||||||
Client client;
|
Client client;
|
||||||
synchronized (sLock) {
|
synchronized (sLock) {
|
||||||
client = mClient;
|
client = mClient;
|
||||||
}
|
}
|
||||||
if (client != null) {
|
if (client != null) {
|
||||||
try {
|
try {
|
||||||
int requestId = mNextRequestId.getAndIncrement();
|
|
||||||
mMediaRouterService.transferToRouteWithManager(
|
mMediaRouterService.transferToRouteWithManager(
|
||||||
mClient, requestId, sessionInfo.getId(), route);
|
mClient, requestId, sessionInfo.getId(), route);
|
||||||
} catch (RemoteException ex) {
|
} catch (RemoteException ex) {
|
||||||
@@ -884,19 +955,11 @@ public final class MediaRouter2Manager {
|
|||||||
public void onRoutesChanged(@NonNull List<MediaRoute2Info> routes) {}
|
public void onRoutesChanged(@NonNull List<MediaRoute2Info> routes) {}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Called when a routing session is created.
|
* Called when a session is changed.
|
||||||
*
|
* @param sessionInfo the updated session
|
||||||
* @param controller the controller to control the created session
|
|
||||||
*/
|
*/
|
||||||
public void onSessionCreated(@NonNull RoutingController controller) {}
|
public void onSessionUpdated(@NonNull RoutingSessionInfo sessionInfo) {}
|
||||||
|
|
||||||
/**
|
|
||||||
* Called when at least one session info is changed.
|
|
||||||
* Call {@link #getActiveSessions()} to get current active session info.
|
|
||||||
*/
|
|
||||||
public void onSessionsUpdated() {}
|
|
||||||
|
|
||||||
//TODO: Call this.
|
|
||||||
/**
|
/**
|
||||||
* Called when media is transferred.
|
* Called when media is transferred.
|
||||||
*
|
*
|
||||||
@@ -906,7 +969,6 @@ public final class MediaRouter2Manager {
|
|||||||
public void onTransferred(@NonNull RoutingSessionInfo oldSession,
|
public void onTransferred(@NonNull RoutingSessionInfo oldSession,
|
||||||
@Nullable RoutingSessionInfo newSession) { }
|
@Nullable RoutingSessionInfo newSession) { }
|
||||||
|
|
||||||
//TODO: Call this.
|
|
||||||
/**
|
/**
|
||||||
* Called when {@link #transfer(RoutingSessionInfo, MediaRoute2Info)} fails.
|
* Called when {@link #transfer(RoutingSessionInfo, MediaRoute2Info)} fails.
|
||||||
*/
|
*/
|
||||||
@@ -971,25 +1033,37 @@ public final class MediaRouter2Manager {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static final class TransferRequest {
|
||||||
|
public final int mRequestId;
|
||||||
|
public final RoutingSessionInfo mOldSessionInfo;
|
||||||
|
public final MediaRoute2Info mTargetRoute;
|
||||||
|
|
||||||
|
TransferRequest(int requestId, @NonNull RoutingSessionInfo oldSessionInfo,
|
||||||
|
@NonNull MediaRoute2Info targetRoute) {
|
||||||
|
mRequestId = requestId;
|
||||||
|
mOldSessionInfo = oldSessionInfo;
|
||||||
|
mTargetRoute = targetRoute;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
class Client extends IMediaRouter2Manager.Stub {
|
class Client extends IMediaRouter2Manager.Stub {
|
||||||
@Override
|
@Override
|
||||||
public void notifySessionCreated(RoutingSessionInfo sessionInfo) {
|
public void notifySessionCreated(int requestId, RoutingSessionInfo sessionInfo) {
|
||||||
mHandler.sendMessage(obtainMessage(MediaRouter2Manager::notifySessionCreated,
|
mHandler.sendMessage(obtainMessage(MediaRouter2Manager::createSessionOnHandler,
|
||||||
MediaRouter2Manager.this, sessionInfo));
|
MediaRouter2Manager.this, requestId, sessionInfo));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void notifySessionsUpdated() {
|
public void notifySessionUpdated(RoutingSessionInfo sessionInfo) {
|
||||||
mHandler.sendMessage(obtainMessage(MediaRouter2Manager::notifySessionInfosChanged,
|
mHandler.sendMessage(obtainMessage(MediaRouter2Manager::handleSessionsUpdated,
|
||||||
MediaRouter2Manager.this));
|
MediaRouter2Manager.this, sessionInfo));
|
||||||
// do nothing
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void notifyRequestFailed(int requestId, int reason) {
|
public void notifyRequestFailed(int requestId, int reason) {
|
||||||
// Note: requestId is not used.
|
// Note: requestId is not used.
|
||||||
mHandler.sendMessage(obtainMessage(MediaRouter2Manager::notifyRequestFailed,
|
mHandler.sendMessage(obtainMessage(MediaRouter2Manager::handleFailureOnHandler,
|
||||||
MediaRouter2Manager.this, reason));
|
MediaRouter2Manager.this, requestId, reason));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -231,9 +231,10 @@ public class MediaRouter2ManagerTest {
|
|||||||
addRouterCallback(new RouteCallback() {});
|
addRouterCallback(new RouteCallback() {});
|
||||||
addManagerCallback(new MediaRouter2Manager.Callback() {
|
addManagerCallback(new MediaRouter2Manager.Callback() {
|
||||||
@Override
|
@Override
|
||||||
public void onSessionCreated(MediaRouter2Manager.RoutingController controller) {
|
public void onTransferred(RoutingSessionInfo oldSessionInfo,
|
||||||
if (TextUtils.equals(mPackageName, controller.getClientPackageName())
|
RoutingSessionInfo newSessionInfo) {
|
||||||
&& createRouteMap(controller.getSelectedRoutes()).containsKey(ROUTE_ID1)) {
|
if (TextUtils.equals(mPackageName, newSessionInfo.getClientPackageName())
|
||||||
|
&& newSessionInfo.getSelectedRoutes().contains(ROUTE_ID1)) {
|
||||||
latch.countDown();
|
latch.countDown();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -268,8 +269,9 @@ public class MediaRouter2ManagerTest {
|
|||||||
|
|
||||||
addManagerCallback(new MediaRouter2Manager.Callback() {
|
addManagerCallback(new MediaRouter2Manager.Callback() {
|
||||||
@Override
|
@Override
|
||||||
public void onSessionCreated(MediaRouter2Manager.RoutingController controller) {
|
public void onTransferred(RoutingSessionInfo oldSessionInfo,
|
||||||
assertNotNull(controller);
|
RoutingSessionInfo newSessionInfo) {
|
||||||
|
assertNotNull(newSessionInfo);
|
||||||
onSessionCreatedLatch.countDown();
|
onSessionCreatedLatch.countDown();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -352,8 +354,9 @@ public class MediaRouter2ManagerTest {
|
|||||||
// create a controller
|
// create a controller
|
||||||
addManagerCallback(new MediaRouter2Manager.Callback() {
|
addManagerCallback(new MediaRouter2Manager.Callback() {
|
||||||
@Override
|
@Override
|
||||||
public void onSessionCreated(MediaRouter2Manager.RoutingController controller) {
|
public void onTransferred(RoutingSessionInfo oldSessionInfo,
|
||||||
assertNotNull(controller);
|
RoutingSessionInfo newSessionInfo) {
|
||||||
|
assertNotNull(newSessionInfo);
|
||||||
onSessionCreatedLatch.countDown();
|
onSessionCreatedLatch.countDown();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -383,13 +386,12 @@ public class MediaRouter2ManagerTest {
|
|||||||
|
|
||||||
addManagerCallback(new MediaRouter2Manager.Callback() {
|
addManagerCallback(new MediaRouter2Manager.Callback() {
|
||||||
@Override
|
@Override
|
||||||
public void onSessionsUpdated() {
|
public void onSessionUpdated(RoutingSessionInfo updatedSessionInfo) {
|
||||||
List<RoutingSessionInfo> sessions = mManager.getRoutingSessions(mPackageName);
|
if (!TextUtils.equals(sessionInfo.getId(), updatedSessionInfo.getId())) {
|
||||||
if (sessions.size() != 2) {
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (sessions.get(1).getVolume() == targetVolume) {
|
if (updatedSessionInfo.getVolume() == targetVolume) {
|
||||||
volumeChangedLatch.countDown();
|
volumeChangedLatch.countDown();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1403,7 +1403,8 @@ class MediaRouter2ServiceImpl {
|
|||||||
|
|
||||||
private void onSessionCreatedOnHandler(@NonNull MediaRoute2Provider provider,
|
private void onSessionCreatedOnHandler(@NonNull MediaRoute2Provider provider,
|
||||||
long uniqueRequestId, @NonNull RoutingSessionInfo sessionInfo) {
|
long uniqueRequestId, @NonNull RoutingSessionInfo sessionInfo) {
|
||||||
notifySessionCreatedToManagers(getManagers(), sessionInfo);
|
notifySessionCreatedToManagers(getManagers(),
|
||||||
|
toOriginalRequestId(uniqueRequestId), sessionInfo);
|
||||||
|
|
||||||
if (uniqueRequestId == REQUEST_ID_NONE) {
|
if (uniqueRequestId == REQUEST_ID_NONE) {
|
||||||
// The session is created without any matching request.
|
// The session is created without any matching request.
|
||||||
@@ -1457,7 +1458,7 @@ class MediaRouter2ServiceImpl {
|
|||||||
private void onSessionInfoChangedOnHandler(@NonNull MediaRoute2Provider provider,
|
private void onSessionInfoChangedOnHandler(@NonNull MediaRoute2Provider provider,
|
||||||
@NonNull RoutingSessionInfo sessionInfo) {
|
@NonNull RoutingSessionInfo sessionInfo) {
|
||||||
List<IMediaRouter2Manager> managers = getManagers();
|
List<IMediaRouter2Manager> managers = getManagers();
|
||||||
notifySessionInfosChangedToManagers(managers);
|
notifySessionInfoChangedToManagers(managers, sessionInfo);
|
||||||
|
|
||||||
// For system provider, notify all routers.
|
// For system provider, notify all routers.
|
||||||
if (provider == mSystemProvider) {
|
if (provider == mSystemProvider) {
|
||||||
@@ -1480,7 +1481,7 @@ class MediaRouter2ServiceImpl {
|
|||||||
private void onSessionReleasedOnHandler(@NonNull MediaRoute2Provider provider,
|
private void onSessionReleasedOnHandler(@NonNull MediaRoute2Provider provider,
|
||||||
@NonNull RoutingSessionInfo sessionInfo) {
|
@NonNull RoutingSessionInfo sessionInfo) {
|
||||||
List<IMediaRouter2Manager> managers = getManagers();
|
List<IMediaRouter2Manager> managers = getManagers();
|
||||||
notifySessionInfosChangedToManagers(managers);
|
notifySessionInfoChangedToManagers(managers, sessionInfo);
|
||||||
|
|
||||||
RouterRecord routerRecord = mSessionToRouterMap.get(sessionInfo.getId());
|
RouterRecord routerRecord = mSessionToRouterMap.get(sessionInfo.getId());
|
||||||
if (routerRecord == null) {
|
if (routerRecord == null) {
|
||||||
@@ -1558,7 +1559,8 @@ class MediaRouter2ServiceImpl {
|
|||||||
private void notifySessionCreationFailedToRouter(@NonNull RouterRecord routerRecord,
|
private void notifySessionCreationFailedToRouter(@NonNull RouterRecord routerRecord,
|
||||||
int requestId) {
|
int requestId) {
|
||||||
try {
|
try {
|
||||||
routerRecord.mRouter.notifySessionCreated(requestId, /* sessionInfo= */ null);
|
routerRecord.mRouter.notifySessionCreated(requestId,
|
||||||
|
/* sessionInfo= */ null);
|
||||||
} catch (RemoteException ex) {
|
} catch (RemoteException ex) {
|
||||||
Slog.w(TAG, "Failed to notify router of the session creation failure."
|
Slog.w(TAG, "Failed to notify router of the session creation failure."
|
||||||
+ " Router probably died.", ex);
|
+ " Router probably died.", ex);
|
||||||
@@ -1731,10 +1733,10 @@ class MediaRouter2ServiceImpl {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void notifySessionCreatedToManagers(@NonNull List<IMediaRouter2Manager> managers,
|
private void notifySessionCreatedToManagers(@NonNull List<IMediaRouter2Manager> managers,
|
||||||
@NonNull RoutingSessionInfo sessionInfo) {
|
int requestId, @NonNull RoutingSessionInfo sessionInfo) {
|
||||||
for (IMediaRouter2Manager manager : managers) {
|
for (IMediaRouter2Manager manager : managers) {
|
||||||
try {
|
try {
|
||||||
manager.notifySessionCreated(sessionInfo);
|
manager.notifySessionCreated(requestId, sessionInfo);
|
||||||
} catch (RemoteException ex) {
|
} catch (RemoteException ex) {
|
||||||
Slog.w(TAG, "notifySessionCreatedToManagers: "
|
Slog.w(TAG, "notifySessionCreatedToManagers: "
|
||||||
+ "failed to notify. Manager probably died.", ex);
|
+ "failed to notify. Manager probably died.", ex);
|
||||||
@@ -1742,11 +1744,12 @@ class MediaRouter2ServiceImpl {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void notifySessionInfosChangedToManagers(
|
private void notifySessionInfoChangedToManagers(
|
||||||
@NonNull List<IMediaRouter2Manager> managers) {
|
@NonNull List<IMediaRouter2Manager> managers,
|
||||||
|
@NonNull RoutingSessionInfo sessionInfo) {
|
||||||
for (IMediaRouter2Manager manager : managers) {
|
for (IMediaRouter2Manager manager : managers) {
|
||||||
try {
|
try {
|
||||||
manager.notifySessionsUpdated();
|
manager.notifySessionUpdated(sessionInfo);
|
||||||
} catch (RemoteException ex) {
|
} catch (RemoteException ex) {
|
||||||
Slog.w(TAG, "notifySessionInfosChangedToManagers: "
|
Slog.w(TAG, "notifySessionInfosChangedToManagers: "
|
||||||
+ "failed to notify. Manager probably died.", ex);
|
+ "failed to notify. Manager probably died.", ex);
|
||||||
|
|||||||
Reference in New Issue
Block a user