Camera: Fix the crash which may occur when suspend resume key is pressed
continuously

If the suspend resume key is pressed in succession, the callbacks in
receiveRawPicture and receiveRawSnapshot may result in a crash. These
callbacks run in a child thread. Once the mMsgEbaled is checked in these
routines, they block on get picture ioctl. Meanwhile if the main thread
disables all callback messages on suspend request, when child thread executes,
callback results in a crash. So a check is added again before the callback
is being actually executed.

Change-Id: I4ef41ea6f30a570c96df9c605b6a2c84125efae7
diff --git a/QualcommCameraHardware.cpp b/QualcommCameraHardware.cpp
index 63d151f..ca13105 100644
--- a/QualcommCameraHardware.cpp
+++ b/QualcommCameraHardware.cpp
@@ -3440,8 +3440,8 @@
         memcpy(mRawSnapshotAshmemHeap->mHeap->base(),
                 mRawSnapShotPmemHeap->mHeap->base(),
                 mRawSnapShotPmemHeap->mHeap->getSize());
-
-        mDataCallback(CAMERA_MSG_COMPRESSED_IMAGE, mRawSnapshotAshmemHeap->mBuffers[0],
+       if (mDataCallback && (mMsgEnabled & CAMERA_MSG_COMPRESSED_IMAGE))
+           mDataCallback(CAMERA_MSG_COMPRESSED_IMAGE, mRawSnapshotAshmemHeap->mBuffers[0],
                 mCallbackCookie);
 
     }
@@ -3495,8 +3495,8 @@
 	    LOGD(" Queueing Postview for display ");
 	    mOverlay->queueBuffer((void *)0);
 	}
-
-        mDataCallback(CAMERA_MSG_RAW_IMAGE, mDisplayHeap->mBuffers[0],
+   if (mDataCallback && (mMsgEnabled & CAMERA_MSG_RAW_IMAGE))
+       mDataCallback(CAMERA_MSG_RAW_IMAGE, mDisplayHeap->mBuffers[0],
                             mCallbackCookie);
     }
     else LOGV("Raw-picture callback was canceled--skipping.");