Hi Javier -
That looks reasonable enough to me! I think it'll handle the various autofocus modes fairly gracefully as well.
I guess one possible problem is that `isFocusing` just indicates when the lens is moving - you may have poor focus if AF_STATE is `NOT_FOCUSED_LOCKED` or `PASSIVE_UNFOCUSED` or `INACTIVE`. But in those cases, AF isn't trying to fix the problem, so it may be persistent (until a change in AF mode, AF is unlocked, or AF is triggered to do a scan). But if you're generally using CameraX's focus metering action, you'll probably only run into poor focus states if the user is holding the device too close to the scene, or it's too dark. So it may be best to try to run analysis anyway, since the scene may never get better.
Good luck with your project!
- Eddy