Camera2: Stop preview: Wait until HAL is drained

Once camera returns from stopPreview, all preview activity needs to
have stopped. So wait until that's true.

Bug: 6243944
Change-Id: Ifa6cf171bd69015883e26dafb1e49e5ac098025a
diff --git a/services/camera/libcameraservice/Camera2Client.cpp b/services/camera/libcameraservice/Camera2Client.cpp
index a115ef4..f21a518 100644
--- a/services/camera/libcameraservice/Camera2Client.cpp
+++ b/services/camera/libcameraservice/Camera2Client.cpp
@@ -592,6 +592,7 @@
             // TODO: Handle record stop here
         case PREVIEW:
             mDevice->setStreamingRequest(NULL);
+            mDevice->waitUntilDrained();
         case WAITING_FOR_PREVIEW_WINDOW:
             mState = STOPPED;
             break;