Aperture: Disable video quality button when there's only one quality available

Change-Id: Ia7432e99d53b35ee3280d6f18ffa6b046777d252
diff --git a/app/src/main/java/org/lineageos/aperture/CameraActivity.kt b/app/src/main/java/org/lineageos/aperture/CameraActivity.kt
index 1b22884..4b626c1 100644
--- a/app/src/main/java/org/lineageos/aperture/CameraActivity.kt
+++ b/app/src/main/java/org/lineageos/aperture/CameraActivity.kt
@@ -921,7 +921,6 @@
             timerButton.isEnabled = cameraState == CameraState.IDLE
             aspectRatioButton.isEnabled = cameraState == CameraState.IDLE
             effectButton.isEnabled = cameraState == CameraState.IDLE
-            videoQualityButton.isEnabled = cameraState == CameraState.IDLE
             settingsButton.isEnabled = cameraState == CameraState.IDLE
 
             lensSelectorLayout.children.forEach { view ->
@@ -1781,7 +1780,8 @@
             val videoQuality = model.videoQuality.value ?: return@runOnUiThread
             val videoAudioConfig = model.videoAudioConfig.value ?: return@runOnUiThread
 
-            val supportedVideoFrameRates = camera.supportedVideoQualities.getOrDefault(
+            val supportedVideoQualities = camera.supportedVideoQualities
+            val supportedVideoFrameRates = supportedVideoQualities.getOrDefault(
                 videoQuality, setOf()
             )
 
@@ -1790,6 +1790,8 @@
             effectButton.isVisible = cameraMode == CameraMode.PHOTO &&
                     photoCaptureMode != ImageCapture.CAPTURE_MODE_ZERO_SHUTTER_LAG &&
                     camera.supportedExtensionModes.size > 1
+            videoQualityButton.isEnabled =
+                cameraState == CameraState.IDLE && supportedVideoQualities.size > 1
             videoFrameRateButton.isEnabled =
                 cameraState == CameraState.IDLE && supportedVideoFrameRates.size > 1
             micButton.isEnabled = cameraState == CameraState.IDLE || videoAudioConfig.audioEnabled