diff --git a/cameraview/src/main/java/com/otaliastudios/cameraview/CameraView.java b/cameraview/src/main/java/com/otaliastudios/cameraview/CameraView.java index 5dbd656b..07c1d6b4 100644 --- a/cameraview/src/main/java/com/otaliastudios/cameraview/CameraView.java +++ b/cameraview/src/main/java/com/otaliastudios/cameraview/CameraView.java @@ -726,6 +726,14 @@ public class CameraView extends FrameLayout implements LifecycleObserver { //region Lifecycle APIs + /** + * Sets permissions flag if you want enable auto check permissions or disable it. + * @param requestPermissions - true: auto check permissions enabled, false: auto check permissions disabled. + */ + public void setRequestPermissions(boolean requestPermissions) { + mRequestPermissions = requestPermissions; + } + /** * Returns whether the camera engine has started. * @return whether the camera has started diff --git a/docs/_docs/runtime-permissions.md b/docs/_docs/runtime-permissions.md index 8db0108b..d1fe24e6 100644 --- a/docs/_docs/runtime-permissions.md +++ b/docs/_docs/runtime-permissions.md @@ -46,4 +46,4 @@ The automatic request is currently done at the activity level, so the permission `onRequestPermissionResults()` will be invoked on the parent activity, not the fragment. The automatic request can be disabled by setting `app:cameraRequestPermissions="false"` in your -XML declaration. \ No newline at end of file +XML declaration or by using this method `setRequestPermissions(boolean requestPermissions)` in your code. \ No newline at end of file