CaptureModule: always adjust camera direction when opened from Assistant

While we want to keep the last camera direction when opened manually, we
don't get any indication that we should open the rear camera from Google
Assistant, only for the front camera so let's always update the camera
direction when opened from the Assistant.

Issue: FP2A10-205
Test: run gts-dev -m GtsAssistantHostTestCases
Change-Id: Id542aa468f2ab08249d263074f1db2fe09e01d50
diff --git a/src/com/android/camera/CaptureModule.java b/src/com/android/camera/CaptureModule.java
index ddba88e..7213e34 100644
--- a/src/com/android/camera/CaptureModule.java
+++ b/src/com/android/camera/CaptureModule.java
@@ -435,8 +435,11 @@
             Log.i(TAG, "Intent extras: " + key + "=\"" + extras.get(key) + "\"");
         }
 
-        // Open the correct camera based on the intent
-        if (intent.hasExtra("android.intent.extra.USE_FRONT_CAMERA")) {
+        // Adjust the camera direction if opened from Google Assistant
+        Uri referrer = activity.getReferrer();
+        if (referrer != null &&
+                referrer.getScheme().equals("android-app") &&
+                referrer.getHost().equals("com.google.android.googlequicksearchbox")) {
             CameraId cameraId;
             if (intent.getBooleanExtra("android.intent.extra.USE_FRONT_CAMERA", false)) {
                 cameraId = mOneCameraManager.findFirstCameraFacing(Facing.FRONT);