Merge "Camera2Client: avoid two consecutive sets of configure_streams calls" into lmp-dev
diff --git a/services/camera/libcameraservice/api1/Camera2Client.cpp b/services/camera/libcameraservice/api1/Camera2Client.cpp
index 3610362..2a6aa7b 100644
--- a/services/camera/libcameraservice/api1/Camera2Client.cpp
+++ b/services/camera/libcameraservice/api1/Camera2Client.cpp
@@ -995,6 +995,10 @@
case Parameters::STOPPED:
res = startPreviewL(params, false);
if (res != OK) return res;
+ // Make sure first preview request is submitted to the HAL device to avoid
+ // two consecutive set of configure_streams being called into the HAL.
+ // TODO: Refactor this to avoid initial preview configuration.
+ syncWithDevice();
break;
case Parameters::PREVIEW:
// Ready to go