Camera: setCallBackWindow only if callback surface is used

Calling setCallBackWindow without checking the previewCallbackSurface could make
the stream to be deleted during callback stream operation, which is bad because
the preview is still active and the delete fails.

Bug: 10730496
Change-Id: I8addac25e5aa7901bf200d730c749bee2c088090
diff --git a/services/camera/libcameraservice/api1/Camera2Client.cpp b/services/camera/libcameraservice/api1/Camera2Client.cpp
index bda2887..e7f6c53 100644
--- a/services/camera/libcameraservice/api1/Camera2Client.cpp
+++ b/services/camera/libcameraservice/api1/Camera2Client.cpp
@@ -604,7 +604,7 @@
     }
     if (params.previewCallbackFlags != (uint32_t)flag) {
 
-        if (flag != CAMERA_FRAME_CALLBACK_FLAG_NOOP) {
+        if (params.previewCallbackSurface && flag != CAMERA_FRAME_CALLBACK_FLAG_NOOP) {
             // Disable any existing preview callback window when enabling
             // preview callback flags
             res = mCallbackProcessor->setCallbackWindow(NULL);