[Google Camera Mods] NoSauce:
GCam Crashes when focused circle moves outside of screen when zooming

Problem: GCam crashes when the focused point/circle moves outside of the screen during the process of zooming.

How to Repeat the problem:

1. Focus on an object by single tapping on the object on your screen. A small circle will appear on the object and will track the object (circle will remain on the object). The focus is "locked-in" to the object.

2a. Zoom-in such that this focus circle moves outside the field of view (focus circle moves off the screen whilst zooming). GCam crashes.

2b. Move the phone away such that the focus circle moves off the screen. Then zoom-in. GCam crashes.

- Note 1: This happens whether you pinch out to zoom OR you use the zoom slider.

- Note 2: So long as the little focus circle stays within the screen whilst zooming, GCam does not crash.

This is present across multiple devices, rooted and unrooted, stock rom and custom rom, at least on Android 10. See quotes below for details. Here are my specs:

GCam_7.2.010_Urnyx05-v2.2.apk

OnePlus 7T (HD 1905) bought directly from OnePlus website (US).

Android 10, bootloader unlocked, ROOTED (Magisk 20.4), YES custom rom (OmniROM omni-10-20200201-oneplus7t-OTA.zip), NO custom recovery (no TWRP), OmniROM came with 2 other cameras: Omni Cam and OnePlus Camera. Neither has this problem.

- I've confirmed that the same GCam zoom crash occurs with my front cam and back cam, normal tele and wide cams, default setting and when using the following suggested xml file: pixel4_v.5_urnyx2.2.xml

Below are quotes from this thread expressing the same problem. I'll make some comments in hopes to pin down the problem. There are some mentions of crashing when zooming in the GCam for OnePlus 7T thread (my phone) but it's unclear if it's the Urnyx05 version.

Some people describe that the pinch zoom works but the zoom slider does not work. This is likely occurring because step 1 above is not occurring. That is, the camera focus is not locked into anything (there is no focus circle tracking an object). Simply pinching in and out on the screen (two fingers) does not cause the camera to lock its focus on an object. However, in order to bring up the zoom slider, you must single tap on the screen (double tap works too, but most people single tap). When you single tap on the screen it not only brings up the zoom slider, but it ALSO focuses in on where you tap at the same time (locks in with focus circle). Hence, during the subsequent zoom using the slider will crash GCam (step 2, above).

Unlike a single tap, a double tap does NOT focus on where you're tapping (the focus circle does not lock in on anything, it just appears then disappears). That's why it doesn't crash, it doesn't matter whether you use the slider or pinch out.

In the above quote, there is no single tap, hence no crash. Whether you zoom in using the slider or zoom in by pinching is irrelevant.

Have you tried zooming in while maintaining the focus circle within the screen/field-of-view? Does it still crash?

What do you mean by focal length? Isn't this the distance between the lens and where it focuses (the sensor)? Or are you talking about the distance between the camera and the object it's focusing on. Does your camera only crash on normal camera? Or does it crash on Wide and Tele cams as well?

Your camera (OnePlus 7 Pro) has a 3x optical zoom for the Tele. The OnePlus 7T has a 2x optical zoom. 7T also has Macro mode (not sure if this is software, not hardware). Do you think these kind of small differences are responsible for why people are experiencing Zoom crashes on different devices?

[MENTION=9040262]Urnyx05[/MENTION] and the other developers that helped, Thank You so much for your hard work. The XML files are much appreciated too. They sound like a lot of work. Thank you.

[MENTION=9040262]Urnyx05[/MENTION] Please, let me know if posting a log file, or screen record is needed.