public void registerReceiver(BroadcastReceiver receiver,IntentFilter filter){
synchronized (mReceivers) {
    ReceiverRecord entry=new ReceiverRecord(filter,receiver);
    ArrayList<IntentFilter> filters=mReceivers.get(receiver);
    if (filters == null) {
      filters=new ArrayList<IntentFilter>(1);
      mReceivers.put(receiver,filters);
    }
    filters.add(filter);
    for (int i=0; i < filter.countActions(); i++) {
      String action=filter.getAction(i);
      ArrayList<ReceiverRecord> entries=mActions.get(action);
      if (entries == null) {
        entries=new ArrayList<ReceiverRecord>(1);
        mActions.put(action,entries);
      }
      entries.add(entry);
    }
  }
}

public void registerReceiver ( BroadcastReceiver receiver , IntentFilter filter ) { synchronized ( mReceivers ) { ReceiverRecord entry = new ReceiverRecord ( filter , receiver ) ; ArrayList < IntentFilter > filters = mReceivers . get ( receiver ) ; if ( filters == null ) { filters = new ArrayList < IntentFilter > ( 1 ) ; mReceivers . put ( receiver , filters ) ; } filters . add ( filter ) ; for ( int i = 0 ; i < filter . countActions ( ) ; i ++ ) { String action = filter . getAction ( i ) ; ArrayList < ReceiverRecord > entries = mActions . get ( action ) ; if ( entries == null ) { entries = new ArrayList < ReceiverRecord > ( 1 ) ; mActions . put ( action , entries ) ; } entries . add ( entry ) ; } } }
register a receive for any local broadcasts that match the given intentfilter .
