Give Smart Camera a signal to start

Change-Id: I1b31d4cbf81a5865ef0807b07df0f644fa871247
diff --git a/src/com/android/camera/CameraActivity.java b/src/com/android/camera/CameraActivity.java
index a9a8d99..e913ac5 100644
--- a/src/com/android/camera/CameraActivity.java
+++ b/src/com/android/camera/CameraActivity.java
@@ -786,6 +786,7 @@
                 new CameraManager.CameraPreviewDataCallback() {
                     @Override
                     public void onPreviewFrame(byte[] data, CameraManager.CameraProxy camera) {
+                        mCurrentModule.onPreviewInitialDataReceived();
                         mCameraAppUI.onNewPreviewFrame();
                     }
                 });
diff --git a/src/com/android/camera/CameraModule.java b/src/com/android/camera/CameraModule.java
index 04dd00c..89fb746 100644
--- a/src/com/android/camera/CameraModule.java
+++ b/src/com/android/camera/CameraModule.java
@@ -84,6 +84,8 @@
         }
     }
 
+    public void onPreviewInitialDataReceived() {};
+
     /**
      * Releases the back camera through {@link CameraProvider}.
      * This calls {@link
diff --git a/src/com/android/camera/PhotoModule.java b/src/com/android/camera/PhotoModule.java
index 8ff222f..d72a6ae 100644
--- a/src/com/android/camera/PhotoModule.java
+++ b/src/com/android/camera/PhotoModule.java
@@ -372,10 +372,13 @@
         mAppController.onPreviewStarted();
         setCameraState(IDLE);
         startFaceDetection();
-        startSmartCamera();
         locationFirstRun();
     }
 
+    public void onPreviewInitialDataReceived() {
+        startSmartCamera();
+    }
+
     // Prompt the user to pick to record location for the very first run of
     // camera only
     private void locationFirstRun() {
diff --git a/src/com/android/camera/module/ModuleController.java b/src/com/android/camera/module/ModuleController.java
index e2ce30f..ab7b2f7 100644
--- a/src/com/android/camera/module/ModuleController.java
+++ b/src/com/android/camera/module/ModuleController.java
@@ -65,6 +65,11 @@
     public void onPreviewVisibilityChanged(boolean visible);
 
     /**
+     * Called when the first preview data is received.
+     */
+    public void onPreviewInitialDataReceived();
+
+    /**
      * Called when the framework layout orientation changed.
      *
      * @param isLandscape Whether the new orientation is landscape or portrait.