Add shared config for Lyric camera HAL.

The config needs to be moved here to support future PDK builds
where the LyricCameraHAL directory will be absent.

Bug: 280124102
Test: presubmit
Change-Id: If967c3db8bb94cadd761ee19b7665db8b7e4b305
This commit is contained in:
Krzysztof Kosiński 2023-04-29 09:26:55 +00:00
parent 47815b3e2a
commit eea841f1cd
4 changed files with 119 additions and 1 deletions

62
camera/lyric.mk Normal file
View File

@ -0,0 +1,62 @@
PRODUCT_SOONG_NAMESPACES += \
hardware/google/camera \
vendor/google/services/LyricCameraHAL/src \
vendor/google/services/LyricCameraHAL/src/apex
$(call soong_config_set,lyric,use_lyric_camera_hal,true)
$(call soong_config_set,google3a_config,gcam_awb,true)
$(call soong_config_set,google3a_config,ghawb_truetone,true)
# Select GCH backend.
# TODO(b/192681010): This dependency inversion should be removed.
ifneq ($(wildcard vendor/google/services/LyricCameraHAL/src),)
$(call soong_config_set,gch,hwl_library,lyric)
endif
# Check if we're in PDK build
ifeq ($(wildcard vendor/google/camera),)
# If vendor/google/camera doesn't exist, it's a PDK build.
$(call soong_config_set,lyric,pdk_build,true)
else
# Otherwise, it's an internal Google build.
$(call soong_config_set,lyric,pdk_build,false)
PRODUCT_SOONG_NAMESPACES += \
vendor/google/camera \
vendor/google/camera/google_3a/libs_v4 \
vendor/google/camera/rlsservice
# TODO(b/257379485): 3A is incrementally enabling cuttlefish build for native
# code coverage support, temporary require separate namespace for folders that
# can be built successfully.
PRODUCT_SOONG_NAMESPACES += \
vendor/google/camera/google_3a/libs_v4/g3ABase \
vendor/google/camera/google_3a/libs_v4/gABC/native_coverage \
vendor/google/camera/google_3a/libs_v4/gAF \
vendor/google/camera/google_3a/libs_v4/gafd \
vendor/google/camera/google_3a/libs_v4/gHAWB/native_coverage
# Calibration tool for debug builds
PRODUCT_PACKAGES_DEBUG += tarasque_test
# dualcamcapture only works for GMS build. Only enable this apk for GMS userdebug/eng builds
ifeq (,$(filter aosp_% factory_%,$(TARGET_PRODUCT)))
PRODUCT_PACKAGES_DEBUG += dualcamcapture
PRODUCT_COPY_FILES += vendor/google/camera/devices/whi/preinstalled-packages-product-camera-device-vendor-debug.xml:$(TARGET_COPY_OUT_VENDOR)/etc/sysconfig/preinstalled-packages-product-camera-device-vendor-debug.xml
endif
endif # vendor/google/camera check
# Init-time log settings for Google 3A
PRODUCT_PACKAGES += libg3a_standalone_gabc_rc
PRODUCT_PACKAGES += libg3a_standalone_gaf_rc
PRODUCT_PACKAGES += libg3a_standalone_ghawb_rc
# Vendor APEX which contains the camera HAL
PRODUCT_PACKAGES += com.google.pixel.camera.hal
PRODUCT_PACKAGES += init.camera.set-interrupts-ownership
# sepolicy dir is added in dump.mk.
# Make doesn't deduplicate sepolicy dirs, so including it here causes build errors.
PRODUCT_COPY_FILES += vendor/google/services/LyricCameraHAL/src/vendor.android.hardware.camera.preview-dis.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/vendor.android.hardware.camera.preview-dis.xml

View File

@ -0,0 +1,46 @@
# Lyric Soong variables
## `kernel_version`
Example:
```
$(call soong_config_set,lyric,kernel_version,v515)
```
Linux kernel version on the device. Determines the version of the LWIS userspace
API to use in Lyric.
## `soc`
Example:
```
$(call soong_config_set,lyric,soc,gs101)
```
The codename for the chip used in the device. Currently only Google silicon
is supported.
## `camera_hardware`
Example:
```
$(call soong_config_set,lyric,camera_hardware,oriole)
```
Specifies the set of sensors and peripherals present on the device. Determines
the DeviceContext class that will be used.
## `tuning_product`
Example:
```
$(call soong_config_set,lyric,tuning_product,oriole)
```
Specifies the set of tuning data to use. This may be different than
`camera_hardware` because not all devices have their own tuning data;
development-only devices only have the default tuning for their SoC.
## `target_device`
Example:
```
$(call soong_config_set,google3a_config,target_device,oriole)
```
A mixture of `camera_hardware` and `tuning_product` used by 3A.

View File

@ -1,5 +1,5 @@
/vendor/bin/dump/dump_camera u:object_r:dump_camera_exec:s0 /vendor/bin/dump/dump_camera u:object_r:dump_camera_exec:s0
/vendor/bin/init\.camera\.set-interrupts-ownership u:object_r:init-camera-set-interrupts-ownership_exec:s0
# Data # Data
/data/vendor/camera(/.*)? u:object_r:vendor_camera_data_file:s0 /data/vendor/camera(/.*)? u:object_r:vendor_camera_data_file:s0

View File

@ -0,0 +1,10 @@
type init-camera-set-interrupts-ownership, domain;
type init-camera-set-interrupts-ownership_exec, exec_type, vendor_file_type, file_type;
init_daemon_domain(init-camera-set-interrupts-ownership)
allow init-camera-set-interrupts-ownership vendor_toolbox_exec:file rx_file_perms;
allow init-camera-set-interrupts-ownership proc_interrupts:file r_file_perms;
allow init-camera-set-interrupts-ownership proc_irq:dir r_dir_perms;
allow init-camera-set-interrupts-ownership proc_irq:file { r_file_perms setattr };
allow init-camera-set-interrupts-ownership self:capability { chown setuid setgid };