public void registerFmRadioListener(FmRadioListener callback){
synchronized (mRecords) {
    Record record=null;
    int hashCode=callback.hashCode();
    final int n=mRecords.size();
    for (int i=0; i < n; i++) {
      record=mRecords.get(i);
      if (hashCode == record.mHashCode) {
        return;
      }
    }
    record=new Record();
    record.mHashCode=hashCode;
    record.mCallback=callback;
    mRecords.add(record);
  }
}

public void registerFmRadioListener ( FmRadioListener callback ) { synchronized ( mRecords ) { Record record = null ; int hashCode = callback . hashCode ( ) ; final int n = mRecords . size ( ) ; for ( int i = 0 ; i < n ; i ++ ) { record = mRecords . get ( i ) ; if ( hashCode == record . mHashCode ) { return ; } } record = new Record ( ) ; record . mHashCode = hashCode ; record . mCallback = callback ; mRecords . add ( record ) ; } }
register fm radio listener , activity get service state should call this method register fm radio listener
