Revert "Revert "Switch to Google CameraHal""

This reverts commit 2f6bb218a9d7ce2db63dc13312ccfeca93fe4a38.

Bug: 131342297
Test: Successful build

Change-Id: I7f57a4a4a232dfecd0a0fb8efeda981a5ac0abae
diff --git a/shared/config/manifest.xml b/shared/config/manifest.xml
index 7b65d04..26fe910 100644
--- a/shared/config/manifest.xml
+++ b/shared/config/manifest.xml
@@ -88,10 +88,11 @@
     <hal format="hidl">
         <name>android.hardware.camera.provider</name>
         <transport>hwbinder</transport>
+        <impl level="generic"></impl>
         <version>2.4</version>
         <interface>
             <name>ICameraProvider</name>
-            <instance>legacy/0</instance>
+            <instance>internal/0</instance>
         </interface>
     </hal>
     <hal format="hidl">
diff --git a/shared/device.mk b/shared/device.mk
index 548dd7b..46f88f4 100644
--- a/shared/device.mk
+++ b/shared/device.mk
@@ -59,6 +59,9 @@
 PRODUCT_PROPERTY_OVERRIDES += \
     wlan.driver.status=ok
 
+PRODUCT_SOONG_NAMESPACES += hardware/google/camera
+PRODUCT_SOONG_NAMESPACES += vendor/google/camera
+
 #
 # Packages for various cuttlefish-specific tests
 #
@@ -119,7 +122,9 @@
 #
 PRODUCT_COPY_FILES += \
     device/google/cuttlefish/shared/config/audio_policy.conf:$(TARGET_COPY_OUT_VENDOR)/etc/audio_policy.conf \
-    device/google/cuttlefish/shared/config/camera_v3.json:$(TARGET_COPY_OUT_VENDOR)/etc/config/camera.json \
+    hardware/google/camera/devices/EmulatedCamera/hwl/configs/emu_camera_back.json:$(TARGET_COPY_OUT_VENDOR)/etc/config/emu_camera_back.json \
+    hardware/google/camera/devices/EmulatedCamera/hwl/configs/emu_camera_front.json:$(TARGET_COPY_OUT_VENDOR)/etc/config/emu_camera_front.json \
+    hardware/google/camera/devices/EmulatedCamera/hwl/configs/emu_camera_depth.json:$(TARGET_COPY_OUT_VENDOR)/etc/config/emu_camera_depth.json \
     device/google/cuttlefish/shared/config/init.common.rc:$(TARGET_COPY_OUT_VENDOR)/etc/init/hw/init.common.rc \
     device/google/cuttlefish/shared/config/init.cutf_ivsh.rc:$(TARGET_COPY_OUT_VENDOR)/etc/init/hw/init.cutf_ivsh.rc \
     device/google/cuttlefish/shared/config/init.cutf_cvm.rc:$(TARGET_COPY_OUT_VENDOR)/etc/init/hw/init.cutf_cvm.rc \
@@ -247,11 +252,9 @@
 # Camera
 #
 PRODUCT_PACKAGES += \
-    camera.cutf \
-    camera.cutf.jpeg \
-    camera.device@3.2-impl \
-    android.hardware.camera.provider@2.4-impl \
-    android.hardware.camera.provider@2.4-service
+    android.hardware.camera.provider@2.4-service-google \
+    libgooglecamerahwl_impl \
+    android.hardware.camera.provider@2.4-impl-google \
 
 #
 # Gatekeeper
diff --git a/shared/sepolicy/vendor/file_contexts b/shared/sepolicy/vendor/file_contexts
index 0d89289..ab683b8 100644
--- a/shared/sepolicy/vendor/file_contexts
+++ b/shared/sepolicy/vendor/file_contexts
@@ -56,6 +56,7 @@
 /vendor/bin/vport_trigger  u:object_r:vport_trigger_exec:s0
 /vendor/bin/rename_netiface  u:object_r:rename_netiface_exec:s0
 /vendor/bin/hw/libcuttlefish-rild  u:object_r:libcuttlefish_rild_exec:s0
+/vendor/bin/hw/android\.hardware\.camera\.provider@2\.4-service-google u:object_r:hal_camera_default_exec:s0
 /vendor/bin/hw/android\.hardware\.power\.stats@1\.0-service\.mock  u:object_r:hal_power_stats_default_exec:s0
 /vendor/bin/hw/android\.hardware\.bluetooth@1\.0-service\.sim  u:object_r:hal_bluetooth_sim_exec:s0
 /vendor/bin/hw/android\.hardware\.drm@1\.2-service\.clearkey  u:object_r:hal_drm_clearkey_exec:s0