Remove unused high-resolution capture option

The feature provided no benefit on Pixel 7 Pro — both standard and
hi-res modes produced 12MP images since CameraX's standard resolution
list doesn't include the full sensor output.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Ole-Morten Duesund 2026-02-27 15:50:53 +01:00
commit 7abb2ea5a0
2 changed files with 1 additions and 22 deletions

View file

@ -12,7 +12,6 @@ import androidx.camera.core.Preview
import androidx.camera.core.SurfaceRequest
import androidx.camera.core.resolutionselector.AspectRatioStrategy
import androidx.camera.core.resolutionselector.ResolutionSelector
import androidx.camera.core.resolutionselector.ResolutionStrategy
import androidx.camera.lifecycle.ProcessCameraProvider
import androidx.core.content.ContextCompat
import androidx.lifecycle.LifecycleOwner
@ -38,20 +37,6 @@ class CameraManager(private val context: Context) {
val lensController = LensController()
private val _useHighResCapture = MutableStateFlow(false)
val useHighResCapture: StateFlow<Boolean> = _useHighResCapture.asStateFlow()
/**
* Toggles between CameraX default resolution and highest available.
* Rebinds camera use cases to apply the change.
*/
fun setHighResCapture(enabled: Boolean) {
if (_useHighResCapture.value != enabled) {
_useHighResCapture.value = enabled
lifecycleOwnerRef?.let { bindCameraUseCases(it) }
}
}
private val _error = MutableStateFlow<String?>(null)
val error: StateFlow<String?> = _error.asStateFlow()
@ -113,13 +98,6 @@ class CameraManager(private val context: Context) {
val captureBuilder = ImageCapture.Builder()
.setCaptureMode(ImageCapture.CAPTURE_MODE_MAXIMIZE_QUALITY)
if (_useHighResCapture.value) {
val captureResolutionSelector = ResolutionSelector.Builder()
.setResolutionStrategy(ResolutionStrategy.HIGHEST_AVAILABLE_STRATEGY)
.build()
captureBuilder.setResolutionSelector(captureResolutionSelector)
}
imageCapture = captureBuilder.build()
// Select camera based on front/back preference