I have implemented CameraX api to get camera frames using ImageAnalysis use case in a fragment. To close the camera I am using ProcessCameraProvider.unbindAll() method in fragment onPause. But this is not synchronously closing the camera. The method declaration says
Unbinds all use cases from the lifecycle and removes them from CameraX. This will initiate a close of every currently open camera.
Is there a way to close all camera synchronously or wait until all camera get closed?