public void updateListeners(EnumSet<TrackDataType> listeners){
  EnumSet<TrackDataType> neededListeners=EnumSet.copyOf(listeners);
  if (neededListeners.contains(TrackDataType.SAMPLED_OUT_TRACK_POINTS_TABLE)) {
    neededListeners.remove(TrackDataType.SAMPLED_OUT_TRACK_POINTS_TABLE);
    neededListeners.add(TrackDataType.SAMPLED_IN_TRACK_POINTS_TABLE);
  }
  Log.d(TAG,"Updating listeners " + neededListeners);
  Set<TrackDataType> unnecessaryListeners=EnumSet.copyOf(registeredListeners);
  unnecessaryListeners.removeAll(neededListeners);
  Set<TrackDataType> missingListeners=EnumSet.copyOf(neededListeners);
  missingListeners.removeAll(registeredListeners);
  for (  TrackDataType trackDataType : unnecessaryListeners) {
    unregisterListener(trackDataType);
  }
  for (  TrackDataType trackDataType : missingListeners) {
    registerListener(trackDataType);
  }
  registeredListeners.clear();
  registeredListeners.addAll(neededListeners);
}

public void updateListeners ( EnumSet < TrackDataType > listeners ) { EnumSet < TrackDataType > neededListeners = EnumSet . copyOf ( listeners ) ; if ( neededListeners . contains ( TrackDataType . SAMPLED_OUT_TRACK_POINTS_TABLE ) ) { neededListeners . remove ( TrackDataType . SAMPLED_OUT_TRACK_POINTS_TABLE ) ; neededListeners . add ( TrackDataType . SAMPLED_IN_TRACK_POINTS_TABLE ) ; } Log . d ( TAG , "Updating listeners " + neededListeners ) ; Set < TrackDataType > unnecessaryListeners = EnumSet . copyOf ( registeredListeners ) ; unnecessaryListeners . removeAll ( neededListeners ) ; Set < TrackDataType > missingListeners = EnumSet . copyOf ( neededListeners ) ; missingListeners . removeAll ( registeredListeners ) ; for ( TrackDataType trackDataType : unnecessaryListeners ) { unregisterListener ( trackDataType ) ; } for ( TrackDataType trackDataType : missingListeners ) { registerListener ( trackDataType ) ; } registeredListeners . clear ( ) ; registeredListeners . addAll ( neededListeners ) ; }
updates listeners with data source .
