Commits

James Dong authored 248ba23ad28
Fix a race condition in Camera API for handling focus In the case where a previous AF completion was outstanding but before the completion notification reached the application, the application cancelled this AF request, and then started a new AF request. Right after the new AF request, the AF completion notification for earlier AF request reached the application. The application could not tell the AF completion notification was meant for the cancelled AF, but thought the new AF was successfully completed. Subsequently, the application trid to take a picture, which failed as a result. The fix is to add an explicit lock in the Camera.java class to fix the race condition to synchornize autoFocus(), cancelAutoFocus() and the callback of the pending AF completion message. o related-to-bug: 6026480 Change-Id: I33d244d908ac066698e792f641ba88fe228b14a9