diff options
author | Akwasi Boateng <akwasi.boateng@ti.com> | 2011-10-29 14:25:50 -0500 |
---|---|---|
committer | Iliyan Malchev <malchev@google.com> | 2011-12-01 10:40:03 -0800 |
commit | 80a2eeb9c95c24e0dd69e61c3f58e6da36cf703d (patch) | |
tree | f4cadde68787387ebc65cfeeccd84fba6fd175cd /camera | |
parent | 82640237cf0ca200932a66777fd1907d66cd0322 (diff) | |
download | android_hardware_ti_omap4xxx-80a2eeb9c95c24e0dd69e61c3f58e6da36cf703d.tar.gz android_hardware_ti_omap4xxx-80a2eeb9c95c24e0dd69e61c3f58e6da36cf703d.tar.bz2 android_hardware_ti_omap4xxx-80a2eeb9c95c24e0dd69e61c3f58e6da36cf703d.zip |
CameraHAL: Avoids a possible deadlock in AppCallbackNotifier
- 'disableMsgType()' was querying CameraHal for enabled message
types through 'msgTypeEnabled()'. This method will lock 'mLock'
in CameraHal. On the other hand 'takePicture()' inside CameraHal
will also lock 'mLock' before execution. If preview callbacks are
enabled before image capture, then 'takePicture()' will call
AppCallbackNotifier's 'disableMsgType()', which will try to
lock 'mLock' again. Solution, a query to CameraHal for enabled
message types is not needed inside 'disableMsgType()' because the
passed argument 'msgType' already contains all the needed
information.
Signed-off-by: Emilian Peev <epeev@mm-sol.com>
Signed-off-by: Akwasi Boateng <akwasi.boateng@ti.com>
Signed-off-by: Iliyan Malchev <malchev@google.com>
Change-Id: Ia4b7634ce21b8243f08d9124823c77e6bde84a8d
Diffstat (limited to 'camera')
-rw-r--r-- | camera/AppCallbackNotifier.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/camera/AppCallbackNotifier.cpp b/camera/AppCallbackNotifier.cpp index bfdd671..201460d 100644 --- a/camera/AppCallbackNotifier.cpp +++ b/camera/AppCallbackNotifier.cpp @@ -1664,7 +1664,7 @@ status_t AppCallbackNotifier::enableMsgType(int32_t msgType) status_t AppCallbackNotifier::disableMsgType(int32_t msgType) { - if(!mCameraHal->msgTypeEnabled(CAMERA_MSG_PREVIEW_FRAME | CAMERA_MSG_POSTVIEW_FRAME)) { + if( msgType & (CAMERA_MSG_PREVIEW_FRAME | CAMERA_MSG_POSTVIEW_FRAME) ) { mFrameProvider->disableFrameNotification(CameraFrame::PREVIEW_FRAME_SYNC); } |