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

Commit 7bfb0a8d authored by Mark Harman's avatar Mark Harman Committed by Mohammed Althaf T
Browse files

Catch crash in cancelAutoFocus()->capture().

parent 46a75c07
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -6565,6 +6565,12 @@ public class CameraController2 extends CameraController {
                }
                e.printStackTrace();
            }
            catch(IllegalStateException e) {
                if( MyDebug.LOG )
                    Log.d(TAG, "failed to cancel autofocus [captureSession already closed!]");
                e.printStackTrace();
                // got this as a Google Play exception - this means the capture session is already closed
            }
            previewBuilder.set(CaptureRequest.CONTROL_AF_TRIGGER, CameraMetadata.CONTROL_AF_TRIGGER_IDLE);
            this.autofocus_cb = null;
            this.autofocus_time_ms = -1;