diff options
author | Alfred Piccioni <alpic@google.com> | 2023-10-18 16:44:02 +0200 |
---|---|---|
committer | Alfred Piccioni <alpic@google.com> | 2023-10-20 11:52:09 +0000 |
commit | 717dafd56985c8bd1432c28e46c70855803f97d5 (patch) | |
tree | dd48b23a959534a5ebafd0dcf15c419a847307cd /shared/camera | |
parent | d82b6f4f8a8dbd7e61ae27a788e324fe2671013e (diff) | |
download | cuttlefish-717dafd56985c8bd1432c28e46c70855803f97d5.tar.gz |
Refactor Cuttlefish camera config
Since the external camera config needs a few differences from the
standard config, splitting this up into different files should avoid
having a bunch of if statements scattered around.
Since this has internal dependencies, this should merge internally first and then get cherry-picked to AOSP.
Bug: 306609788
Test: Build and run tests.
Change-Id: I3fd7ebfe587c26ab9dff2851f150a694507bbda5
Diffstat (limited to 'shared/camera')
-rw-r--r-- | shared/camera/config/external.mk | 27 | ||||
-rw-r--r-- | shared/camera/config/standard.mk | 33 | ||||
-rw-r--r-- | shared/camera/device_vendor.mk | 20 |
3 files changed, 60 insertions, 20 deletions
diff --git a/shared/camera/config/external.mk b/shared/camera/config/external.mk new file mode 100644 index 000000000..c9886993d --- /dev/null +++ b/shared/camera/config/external.mk @@ -0,0 +1,27 @@ +# +# Copyright (C) 2023 The Android Open Source Project +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +# Load the external feature permissions. +PRODUCT_COPY_FILES += \ + frameworks/native/data/etc/android.hardware.camera.external.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.camera.external.xml + +# Inform the camera HAL that we only want an external camera loaded. +PRODUCT_VENDOR_PROPERTIES += \ + ro.vendor.camera.config=external + +# Load the non-APEX external camera config. The APEX loads all the configs by default, which the HAl picks from. +PRODUCT_COPY_FILES += \ + hardware/google/camera/devices/EmulatedCamera/hwl/configs/emu_camera_external.json:$(TARGET_COPY_OUT_VENDOR)/etc/config/emu_camera_external.json diff --git a/shared/camera/config/standard.mk b/shared/camera/config/standard.mk new file mode 100644 index 000000000..ff6c3f3fe --- /dev/null +++ b/shared/camera/config/standard.mk @@ -0,0 +1,33 @@ +# +# Copyright (C) 2023 The Android Open Source Project +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +# Fills in the features that the full camera array needs. +PRODUCT_COPY_FILES += \ + frameworks/native/data/etc/android.hardware.camera.concurrent.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.camera.concurrent.xml \ + frameworks/native/data/etc/android.hardware.camera.flash-autofocus.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.camera.flash-autofocus.xml \ + frameworks/native/data/etc/android.hardware.camera.front.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.camera.front.xml \ + frameworks/native/data/etc/android.hardware.camera.full.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.camera.full.xml \ + frameworks/native/data/etc/android.hardware.camera.raw.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.camera.raw.xml \ + +# Camera support library; this isn't supported by the external camera config. +PRODUCT_VENDOR_PROPERTIES += \ + ro.camerax.extensions.enabled=true + +# Loads the non-APEX config files. The APEX loads all the configs by default, which the HAl picks from. +PRODUCT_COPY_FILES += \ + 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 diff --git a/shared/camera/device_vendor.mk b/shared/camera/device_vendor.mk index f116fa146..85533dabb 100644 --- a/shared/camera/device_vendor.mk +++ b/shared/camera/device_vendor.mk @@ -14,9 +14,6 @@ # limitations under the License. # -PRODUCT_VENDOR_PROPERTIES += \ - ro.camerax.extensions.enabled=true - # Enable Camera Extension sample ifeq ($(TARGET_USE_CAMERA_ADVANCED_EXTENSION_SAMPLE),true) PRODUCT_PACKAGES += \ @@ -44,23 +41,6 @@ $(call soong_config_set,lyric,camera_hardware,cuttlefish) $(call soong_config_set,lyric,tuning_product,cuttlefish) $(call soong_config_set,google3a_config,target_device,cuttlefish) -PRODUCT_COPY_FILES += \ - frameworks/native/data/etc/android.hardware.camera.concurrent.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.camera.concurrent.xml \ - frameworks/native/data/etc/android.hardware.camera.flash-autofocus.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.camera.flash-autofocus.xml \ - frameworks/native/data/etc/android.hardware.camera.front.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.camera.front.xml \ - frameworks/native/data/etc/android.hardware.camera.full.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.camera.full.xml \ - frameworks/native/data/etc/android.hardware.camera.raw.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.camera.raw.xml \ - -ifeq ($(PRODUCT_IS_ATV_CF),true) - PRODUCT_COPY_FILES += \ - hardware/google/camera/devices/EmulatedCamera/hwl/configs/emu_camera_external.json:$(TARGET_COPY_OUT_VENDOR)/etc/config/emu_camera_external.json -else - PRODUCT_COPY_FILES += \ - 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 -endif - ifeq ($(TARGET_USE_VSOCK_CAMERA_HAL_IMPL),true) PRODUCT_PACKAGES += \ android.hardware.camera.provider@2.7-external-vsock-service \ |