Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit 248ba23a authored by James Dong's avatar James Dong
Browse files

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
parent 427db9b3
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment