Chosen Solution

My Samsung s7 back camera lid is broken is that why my camera isn’t focusing?

Yep, that’s probably why it is not focusing. I would try replacing the lens first and then trying the camera again. If that doesn’t work however, you will need to replace the rear camera itself. Lens Replacement guide and part Samsung Galaxy S7 Rear Camera Lens Replacement Galaxy S7/S7 Edge Rear Camera Bezel Rear camera replacement guide and part Samsung Galaxy S7 Rear Camera Replacement Galaxy S7 Rear Camera (the Samsung camera is out of stock but the Sony cameras are in stock, there is little to no difference.)