if (isToastable)
activity.showToast("Camera is unavailable, maybe it's used by another application !");
} else {
addRequiredPremission(Manifest.permission.CAMERA);
addRequiredPremission(Manifest.permission.FLASHLIGHT);
<BUG>addRequiredPremission(Manifest.permission.WRITE_EXTERNAL_STORAGE);
addRequiredPremission(Manifest.permission.READ_EXTERNAL_STORAGE);</BUG>
if (checkForPermissions()) {
if (selectionAction != null)
selectionAction.onSuccess();

if (isToastable)
activity.showToast("Camera is unavailable, maybe it's used by another application !");
} else {
addRequiredPremission(Manifest.permission.CAMERA);
addRequiredPremission(Manifest.permission.FLASHLIGHT);
addRequiredPremission(Manifest.permission.WRITE_EXTERNAL_STORAGE);
if(Build.VERSION.SDK_INT >=16)
addRequiredPremission(Manifest.permission.READ_EXTERNAL_STORAGE);
if (checkForPermissions()) {
if (selectionAction != null)
selectionAction.onSuccess();
