question: private PermissionRequest submit ( ) { int showRationale = 0 ; ArrayList < String > requests = new ArrayList < > ( ) ; for ( final String permission : mPermissions ) { if ( mActivity . checkSelfPermission ( permission ) != PackageManager . PERMISSION_GRANTED ) { requests . add ( permission ) ; if ( ActivityCompat . shouldShowRequestPermissionRationale ( mActivity , permission ) ) { showRationale ++ ; } } } mRequestCode = mRequestId . addAndGet ( 1 ) ; if ( requests . isEmpty ( ) ) { if ( mCallback != null ) { mCallback . onPermissionsGranted ( ) ; } } else { if ( showRationale == 0 ) { ActivityCompat . requestPermissions ( mActivity , mPermissions , mRequestCode ) ; } else { showRationale ( ) ; } } return this ; }
target:  Submits a requests for a set of permissions for an activity.