fix: Fix wrong HDR error being thrown on LowLight mode

This commit is contained in:
Marc Rousavy 2021-07-07 13:14:36 +02:00
parent 1e64215d37
commit 339b470ca5

View File

@ -313,7 +313,11 @@ class CameraView(context: Context) : FrameLayout(context), LifecycleOwner {
cameraSelector = extensionsManager!!.getExtensionEnabledCameraSelector(cameraProvider, cameraSelector, extension)
} else {
Log.e(TAG, "Extension $extension is not available for the given Camera!")
throw HdrNotContainedInFormatError()
throw when (extension) {
ExtensionMode.HDR -> HdrNotContainedInFormatError()
ExtensionMode.NIGHT -> LowLightBoostNotContainedInFormatError()
else -> Error("Invalid extension supplied! Extension $extension is not available.")
}
}
}