I am testing an android application on a samsung gt i8260, a samsung s4 and a sony ericsson xperia mini st15i.
The application at some point of the code while on preview mode and autofocusing constantly (callback calls camera.autoFocus again every time) calls camera.cancelAutoFocus(), then sets some parameters about flashlight (in order to start or stop torch mode) and finally recalling camera.autoFocus.
Both S4 and Xperia work fine. But gt stops responding after calling camera.cancelAutoFocus which neither returns nor throws an exception. It just hangs.
The documentation for cancelAutoFocus:
Cancels any auto-focus function in progress. Whether or not auto-focus is currently in progress, this function will return the focus position to the default. If the camera does not support auto-focus, this is a no-op.
does not explains this behavior.
Removing cancelAutoFocus works for S4, and GT but not for Xperia which throws an exception on setParameters.
Has anyone face the same or any similar problem? How can I overcome this issue? Is it hardware specific or bug?