@Override
  public boolean performClick() {
    // Send the appropriate accessibility events and call listeners
    boolean handled = super.performClick();
    if (!handled) {
      playSoundEffect(SoundEffectConstants.CLICK);
    }

    if (mToggleMode) {
      if (mRemoteActive) {
        mRouter.selectRouteInt(mRouteTypes, mRouter.getSystemAudioRoute());
      } else {
        final int N = mRouter.getRouteCount();
        for (int i = 0; i < N; i++) {
          final RouteInfo route = mRouter.getRouteAt(i);
          if ((route.getSupportedTypes() & mRouteTypes) != 0
              && route != mRouter.getSystemAudioRoute()) {
            mRouter.selectRouteInt(mRouteTypes, route);
          }
        }
      }
    } else {
      showDialog();
    }

    return handled;
  }
  void updateRemoteIndicator() {
    final RouteInfo selected = mRouter.getSelectedRoute(mRouteTypes);
    final boolean isRemote = selected != mRouter.getSystemAudioRoute();
    final boolean isConnecting = selected.getStatusCode() == RouteInfo.STATUS_CONNECTING;

    boolean needsRefresh = false;
    if (mRemoteActive != isRemote) {
      mRemoteActive = isRemote;
      needsRefresh = true;
    }
    if (mIsConnecting != isConnecting) {
      mIsConnecting = isConnecting;
      needsRefresh = true;
    }

    if (needsRefresh) {
      refreshDrawableState();
    }
  }