From 0f94c2a996a76eaa7e4e25f3ea1cdbf9076e2ceb Mon Sep 17 00:00:00 2001 From: Sergei Mitrofanov Date: Thu, 3 Jun 2021 20:07:52 +0300 Subject: [PATCH] fix: Fix wrong permission errors thrown (#163) --- android/src/main/java/com/mrousavy/camera/CameraView.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/android/src/main/java/com/mrousavy/camera/CameraView.kt b/android/src/main/java/com/mrousavy/camera/CameraView.kt index 4c26b34..ea56f24 100644 --- a/android/src/main/java/com/mrousavy/camera/CameraView.kt +++ b/android/src/main/java/com/mrousavy/camera/CameraView.kt @@ -218,10 +218,10 @@ class CameraView(context: Context) : FrameLayout(context), LifecycleOwner { val startTime = System.currentTimeMillis() Log.i(TAG, "Configuring session...") if (ContextCompat.checkSelfPermission(context, Manifest.permission.CAMERA) != PackageManager.PERMISSION_GRANTED) { - throw MicrophonePermissionError() + throw CameraPermissionError() } if (ContextCompat.checkSelfPermission(context, Manifest.permission.RECORD_AUDIO) != PackageManager.PERMISSION_GRANTED) { - throw CameraPermissionError() + throw MicrophonePermissionError() } if (cameraId == null) { throw NoCameraDeviceError()