public MediaRouterRouteInfoAssert isConnecting() { isNotNull(); assertThat(actual.isConnecting()) // .overridingErrorMessage("Expected to be connecting but was not.") // .isTrue(); return this; }
public MediaRouterRouteInfoAssert isNotConnecting() { isNotNull(); assertThat(actual.isConnecting()) // .overridingErrorMessage("Expected to not be connecting but was.") // .isFalse(); return this; }
@Override public void onRouteChanged(MediaRouter router, RouteInfo route) { // We only care about changes to the current route. if (!route.equals(getCurrentRoute())) return; // When there is no wifi connection, this condition becomes true. if (route.isConnecting()) { // We don't want to post the same Runnable twice. if (!mConnectionFailureNotifierQueued) { mConnectionFailureNotifierQueued = true; getHandler().postDelayed(mConnectionFailureNotifier, CONNECTION_FAILURE_NOTIFICATION_DELAY_MS); } } else { // Only cancel the disconnect if we already posted the message. We can get into this // situation if we swap the current route provider (for example, switching to a YT // video while casting a non-YT video). if (mConnectionFailureNotifierQueued) { // We have reconnected, cancel the delayed disconnect. getHandler().removeCallbacks(mConnectionFailureNotifier); mConnectionFailureNotifierQueued = false; } } }