private synchronized void removePendingAction(@Nullable PermissionsResultAction action){
  for (Iterator<WeakReference<PermissionsResultAction>> iterator=mPendingActions.iterator(); iterator.hasNext(); ) {
    WeakReference<PermissionsResultAction> weakRef=iterator.next();
    if (weakRef.get() == action || weakRef.get() == null) {
      iterator.remove();
    }
  }
}

private synchronized void removePendingAction ( @ Nullable PermissionsResultAction action ) { for ( Iterator < WeakReference < PermissionsResultAction > > iterator = mPendingActions . iterator ( ) ; iterator . hasNext ( ) ; ) { WeakReference < PermissionsResultAction > weakRef = iterator . next ( ) ; if ( weakRef . get ( ) == action || weakRef . get ( ) == null ) { iterator . remove ( ) ; } } }
this method removes a pending action from the list of pending actions . it is used for cases where the permission has already been granted , so you immediately wish to remove the pending action from the queue and execute the action .
