Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit fc031733 authored by Mark Harman's avatar Mark Harman
Browse files

Catch AssertionError from characteristics.get(CameraCharacteristics.CONTROL_ZOOM_RATIO_RANGE).

parent 129369e1
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -51,6 +51,7 @@ Version 1.55 (Work in progress)

FIXED   Crash on some devices when starting preview using camera vendor extensions, now fail
        gracefully instead.
FIXED   Crash related to zoom on some older devices when starting with Camera2 API.
FIXED   Fixed possible crash related to focusing with Camera2 API.
FIXED   Dialog for poor magnetic sensor dialog wasn't showing any text.
FIXED   Ensure the info text for capture progress in x- extension modes remains visible until 100%.
+13 −7
Original line number Diff line number Diff line
@@ -2756,6 +2756,7 @@ public class CameraController2 extends CameraController {
        else if( Build.VERSION.SDK_INT >= Build.VERSION_CODES.R ) {
            // use CONTROL_ZOOM_RATIO_RANGE on Android 11+, to support multiple cameras with zoom ratios
            // less than 1
            try {
                Range<Float> zoom_ratio_range = characteristics.get(CameraCharacteristics.CONTROL_ZOOM_RATIO_RANGE);
                if( zoom_ratio_range != null ) {
                    min_zoom = zoom_ratio_range.getLower();
@@ -2766,6 +2767,11 @@ public class CameraController2 extends CameraController {
                        Log.d(TAG, "zoom_ratio_range not supported");
                }
            }
            catch(AssertionError e) {
                // have had this crash from characteristics.get(CameraCharacteristics.CONTROL_ZOOM_RATIO_RANGE) on Google Play for some older Samsung Galaxy A* and Nokia devices
                MyDebug.logStackTrace(TAG, "failed to CONTROL_ZOOM_RATIO_RANGE", e);
            }
        }
        else {
            min_zoom = 1.0f;
            max_zoom = characteristics.get(CameraCharacteristics.SCALER_AVAILABLE_MAX_DIGITAL_ZOOM);