fragment/src/main/java/androidx/fragment/app/FragmentActivity.java
void requestPermissionsFromFragment(Fragment fragment, String[] permissions,
            int requestCode) {
        if (requestCode == -1) {
            ActivityCompat.requestPermissions(this, permissions, requestCode);
            return;
        }
        checkForValidRequestCode(requestCode);
        try {
            mRequestedPermissionsFromFragment = true;
            int requestIndex = allocateRequestIndex(fragment);
            ActivityCompat.requestPermissions(this, permissions,
                    ((requestIndex + 1) << 16) + (requestCode & 0xffff));
        } finally {
            mRequestedPermissionsFromFragment = false;
        }
    }
/**
     * Called by Fragment.requestPermissions() to implement its behavior.
     */
Called by Fragment.requestPermissions() to implement its behavior.
Called by Fragment . requestPermissions () to implement its behavior .
void requestPermissionsFromFragment(Fragment fragment, String[] permissions,
            int requestCode) {
        if (requestCode == -1) {
            ActivityCompat.requestPermissions(this, permissions, requestCode);
            return;
        }
        checkForValidRequestCode(requestCode);
        try {
            mRequestedPermissionsFromFragment = true;
            int requestIndex = allocateRequestIndex(fragment);
            ActivityCompat.requestPermissions(this, permissions,
                    ((requestIndex + 1) << 16) + (requestCode & 0xffff));
        } finally {
            mRequestedPermissionsFromFragment = false;
        }
    }
void requestPermissionsFromFragment ( Fragment fragment , String [ ] permissions , int requestCode ) { if ( requestCode == - 1 ) { ActivityCompat . requestPermissions ( this , permissions , requestCode ) ; return ; } checkForValidRequestCode ( requestCode ) ; try { mRequestedPermissionsFromFragment = true ; int requestIndex = allocateRequestIndex ( fragment ) ; ActivityCompat . requestPermissions ( this , permissions , ( ( requestIndex + 1 ) << 16 ) + ( requestCode & 0xffff ) ) ; } finally { mRequestedPermissionsFromFragment = false ; } }
Called by Fragment.requestPermissions() to implement its behavior.
Called by Fragment . requestPermissions () to implement its behavior .