Skip to content

Commit 0e6ae53

Browse files
Treehugger RobotGerrit Code Review
Treehugger Robot
authored and
Gerrit Code Review
committed
Merge "Revert "Throw IAE when updating dynamic routes with none selected"" into androidx-main
2 parents 3a33a47 + 7d17ea4 commit 0e6ae53

File tree

1 file changed

+0
-21
lines changed

1 file changed

+0
-21
lines changed

mediarouter/mediarouter/src/main/java/androidx/mediarouter/media/MediaRouteProvider.java

-21
Original file line numberDiff line numberDiff line change
@@ -602,10 +602,6 @@ public void run() {
602602
* the route controller.
603603
* @param dynamicRoutes The dynamic route descriptors for published routes.
604604
* At least a selected or selecting route should be included.
605-
*
606-
* @throws IllegalArgumentException Thrown when no dynamic route descriptors are {@link
607-
* DynamicRouteDescriptor#SELECTED SELECTED} or {@link DynamicRouteDescriptor#SELECTING
608-
* SELECTING}.
609605
*/
610606
public final void notifyDynamicRoutesChanged(
611607
@NonNull MediaRouteDescriptor groupRoute,
@@ -616,23 +612,6 @@ public final void notifyDynamicRoutesChanged(
616612
if (dynamicRoutes == null) {
617613
throw new NullPointerException("dynamicRoutes must not be null");
618614
}
619-
620-
boolean hasSelectedRoute = false;
621-
for (DynamicRouteDescriptor route: dynamicRoutes) {
622-
int state = route.getSelectionState();
623-
if (state == DynamicRouteDescriptor.SELECTED
624-
|| state == DynamicRouteDescriptor.SELECTING) {
625-
hasSelectedRoute = true;
626-
break;
627-
}
628-
}
629-
630-
if (!hasSelectedRoute) {
631-
throw new IllegalArgumentException("dynamicRoutes must have at least one selected"
632-
+ " or selecting route.");
633-
634-
}
635-
636615
synchronized (mLock) {
637616
if (mExecutor != null) {
638617
final OnDynamicRoutesChangedListener listener = mListener;

0 commit comments

Comments
 (0)