public void onRequestPermissionsResult(int requestCode, String permissions[], int[] grantResults) {
        if (requestCode == cameraPermissionReqCode) {
            if (grantResults.length > 0 && grantResults[0] == PackageManager.PERMISSION_GRANTED) {
                // permission was granted
                barcodeView.resume();
            } else {
                setMissingCameraPermissionResult();

                if (showDialogIfMissingCameraPermission) {
                    displayFrameworkBugMessageAndExit(missingCameraPermissionDialogMessage);
                } else {
                    closeAndFinish();
                }
            }
        }
    }
Call from Activity#onRequestPermissionsResult
@param requestCode The request code passed in {@link androidx.core.app.ActivityCompat#requestPermissions(Activity, String[], int)}.
@param permissions The requested permissions.
@param grantResults The grant results for the corresponding permissions
    which is either {@link android.content.pm.PackageManager#PERMISSION_GRANTED}
    or {@link android.content.pm.PackageManager#PERMISSION_DENIED}. Never null.
zxing-android-embedded/src/com/journeyapps/barcodescanner/CaptureManager.java