fix: Fix wrong permission errors thrown (#163)

This commit is contained in:
Sergei Mitrofanov 2021-06-03 20:07:52 +03:00 committed by GitHub
parent 947f5df171
commit 0f94c2a996
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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()