Only restart camera preview if it's running

Previously the camera preview would be restarted even if it wasn't
running. The end result of that was that the camera preview would be
started simply by changing parameters. This caused problems because the
camera client had not set everything up yet.

Test: ran camera CTS tests
Change-Id: I5b3356d1ee952a2b2a88a24072172d8069140461
(cherry picked from commit 9067964fd899de66e0be77b75332c76b852b4da3)
diff --git a/camera/EmulatedCamera.cpp b/camera/EmulatedCamera.cpp
index 8db9a7b..a57d6ac 100755
--- a/camera/EmulatedCamera.cpp
+++ b/camera/EmulatedCamera.cpp
@@ -603,7 +603,7 @@
     // Now that the parameters have been assigned check if the preview needs to
     // be restarted. If necessary this will then use the new parameters to set
     // up the preview as requested by the caller.
-    if (restartPreview) {
+    if (restartPreview && isPreviewEnabled()) {
         status_t status = doStopPreview();
         if (status != NO_ERROR) {
             ALOGE("%s: Stopping preview failed: %d", __FUNCTION__, status);