Switch camera and minigbm gralloc to apex, same as upstream

This commit is contained in:
oxmc
2025-11-02 21:27:23 -08:00
parent 3972c5ca75
commit b33856abbc
11 changed files with 80 additions and 37 deletions

34
camera/external/Android.bp vendored Normal file
View File

@@ -0,0 +1,34 @@
// Copyright (C) 2025 KonstaKANG
//
// SPDX-License-Identifier: Apache-2.0
prebuilt_etc {
name: "android.hardware.camera.provider-V1-external-service.rc",
src: "android.hardware.camera.provider-V1-external-service.rc",
installable: false,
}
prebuilt_etc {
name: "android.hardware.camera.provider-V1-external-service.xml",
src: "android.hardware.camera.provider-V1-external-service.xml",
sub_dir: "vintf",
installable: false,
}
apex {
name: "com.android.hardware.camera.external.rpi5",
manifest: "apex_manifest.json",
file_contexts: "apex_file_contexts",
key: "com.android.hardware.key",
certificate: ":com.android.hardware.certificate",
updatable: false,
vendor: true,
binaries: [
"android.hardware.camera.provider-V1-external-service",
],
prebuilts: [
"android.hardware.camera.provider-V1-external-service.rc",
"android.hardware.camera.provider-V1-external-service.xml",
],
}

View File

@@ -0,0 +1,8 @@
service vendor.camera.provider-ext /apex/com.android.hardware.camera.external.rpi5/bin/hw/android.hardware.camera.provider-V1-external-service
interface aidl android.hardware.camera.provider.ICameraProvider/external/0
class hal
user cameraserver
group audio camera input drmrpc usb
ioprio rt 4
capabilities SYS_NICE
task_profiles CameraServiceCapacity MaxPerformance

View File

@@ -0,0 +1,10 @@
<manifest version="1.0" type="device">
<hal format="aidl">
<name>android.hardware.camera.provider</name>
<version>1</version>
<interface>
<name>ICameraProvider</name>
<instance>external/0</instance>
</interface>
</hal>
</manifest>

3
camera/external/apex_file_contexts vendored Normal file
View File

@@ -0,0 +1,3 @@
(/.*)? u:object_r:vendor_file:s0
/etc(/.*)? u:object_r:vendor_configs_file:s0
/bin/hw/android\.hardware\.camera\.provider-V1-external-service u:object_r:hal_camera_default_exec:s0

4
camera/external/apex_manifest.json vendored Normal file
View File

@@ -0,0 +1,4 @@
{
"name": "com.android.hardware.camera.external.rpi5",
"version": 1
}

View File

@@ -52,21 +52,21 @@ PRODUCT_COPY_FILES += \
# Camera # Camera
PRODUCT_PACKAGES += \ PRODUCT_PACKAGES += \
android.hardware.camera.provider-V1-external-service com.android.hardware.camera.external.rpi5
PRODUCT_COPY_FILES += \ PRODUCT_COPY_FILES += \
$(DEVICE_PATH)/camera/external_camera_config.xml:$(TARGET_COPY_OUT_VENDOR)/etc/external_camera_config.xml $(DEVICE_PATH)/camera/external/external_camera_config.xml:$(TARGET_COPY_OUT_VENDOR)/etc/external_camera_config.xml
PRODUCT_COPY_FILES += \ PRODUCT_COPY_FILES += \
frameworks/native/data/etc/android.hardware.camera.external.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.camera.external.xml frameworks/native/data/etc/android.hardware.camera.external.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.camera.external.xml
PRODUCT_PACKAGES += \ PRODUCT_PACKAGES += \
android.hardware.camera.provider-V1-libcamera-service \ acom.android.hardware.camera.libcamera
camera.libcamera \
ipa_rpi_pisp $(call soong_config_set,libcamera,ipa,pisp)
PRODUCT_COPY_FILES += \ PRODUCT_COPY_FILES += \
$(DEVICE_PATH)/camera/camera_hal.yaml:$(TARGET_COPY_OUT_VENDOR)/etc/libcamera/camera_hal.yaml $(DEVICE_PATH)/camera/libcamera/camera_hal.yaml:$(TARGET_COPY_OUT_VENDOR)/etc/libcamera/camera_hal.yaml
PRODUCT_COPY_FILES += \ PRODUCT_COPY_FILES += \
frameworks/native/data/etc/android.hardware.camera.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.camera.xml \ frameworks/native/data/etc/android.hardware.camera.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.camera.xml \
@@ -116,8 +116,7 @@ PRODUCT_PACKAGES += \
# Graphics # Graphics
PRODUCT_PACKAGES += \ PRODUCT_PACKAGES += \
android.hardware.graphics.allocator-service.minigbm_gbm_mesa \ com.android.hardware.graphics.allocator.minigbm_gbm_mesa
mapper.minigbm_gbm_mesa
PRODUCT_PACKAGES += \ PRODUCT_PACKAGES += \
com.android.hardware.graphics.composer.drm_hwcomposer com.android.hardware.graphics.composer.drm_hwcomposer
@@ -128,10 +127,6 @@ PRODUCT_PACKAGES += \
libGLESv2_mesa \ libGLESv2_mesa \
libgallium_dri libgallium_dri
PRODUCT_PACKAGES += \
dri_gbm \
libgbm_mesa
PRODUCT_COPY_FILES += \ PRODUCT_COPY_FILES += \
frameworks/native/data/etc/android.software.opengles.deqp.level-2024-03-01.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.software.opengles.deqp.level.xml frameworks/native/data/etc/android.software.opengles.deqp.level-2024-03-01.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.software.opengles.deqp.level.xml

View File

@@ -17,13 +17,4 @@
<instance>default</instance> <instance>default</instance>
</interface> </interface>
</hal> </hal>
<hal format="aidl">
<name>android.hardware.camera.provider</name>
<version>1</version>
<interface>
<name>ICameraProvider</name>
<instance>external/0</instance>
<instance>libcamera/0</instance>
</interface>
</hal>
</manifest> </manifest>

View File

@@ -1,6 +1,3 @@
# Camera
/vendor/bin/hw/android\.hardware\.camera\.provider-V1-libcamera-service u:object_r:hal_camera_default_exec:s0
# CEC # CEC
/dev/cec0 u:object_r:cec_device:s0 /dev/cec0 u:object_r:cec_device:s0
/dev/cec1 u:object_r:cec_device:s0 /dev/cec1 u:object_r:cec_device:s0
@@ -9,21 +6,22 @@
/data/vendor/mediadrm(/.*)? u:object_r:mediadrm_vendor_data_file:s0 /data/vendor/mediadrm(/.*)? u:object_r:mediadrm_vendor_data_file:s0
# Graphics # Graphics
/dev/dri(/.*)? u:object_r:gpu_device:s0 /dev/dri(/.*)? u:object_r:gpu_device:s0
/vendor/bin/hw/android\.hardware\.graphics\.allocator-service\.minigbm_gbm_mesa u:object_r:hal_graphics_allocator_default_exec:s0 /vendor/lib64/hw/vulkan\.broadcom\.so u:object_r:same_process_hal_file:s0
/vendor/lib64/hw/mapper\.minigbm_gbm_mesa\.so u:object_r:same_process_hal_file:s0 /vendor/lib64/libdrm\.so u:object_r:same_process_hal_file:s0
/vendor/lib64/hw/vulkan\.broadcom\.so u:object_r:same_process_hal_file:s0 /vendor/lib64/libgallium_dri\.so u:object_r:same_process_hal_file:s0
/vendor/lib64/dri_gbm\.so u:object_r:same_process_hal_file:s0 /vendor/lib64/libui\.so u:object_r:same_process_hal_file:s0
/vendor/lib64/libdrm\.so u:object_r:same_process_hal_file:s0
/vendor/lib64/libgallium_dri\.so u:object_r:same_process_hal_file:s0
/vendor/lib64/libgbm_mesa\.so u:object_r:same_process_hal_file:s0
/vendor/lib64/libgbm_mesa_wrapper\.so u:object_r:same_process_hal_file:s0
/vendor/lib64/libminigbm_gralloc_gbm_mesa\.so u:object_r:same_process_hal_file:s0
/vendor/lib64/libminigbm_gralloc4_utils_gbm_mesa\.so u:object_r:same_process_hal_file:s0
/vendor/lib64/libui\.so u:object_r:same_process_hal_file:s0
# Partitions # Partitions
/dev/block/mmcblk0p1 u:object_r:boot_block_device:s0 /dev/block/mmcblk0p1 u:object_r:boot_block_device:s0
/dev/block/mmcblk0p2 u:object_r:system_block_device:s0 /dev/block/mmcblk0p2 u:object_r:system_block_device:s0
/dev/block/mmcblk0p3 u:object_r:system_block_device:s0 /dev/block/mmcblk0p3 u:object_r:system_block_device:s0
/dev/block/mmcblk0p4 u:object_r:userdata_block_device:s0 /dev/block/mmcblk0p4 u:object_r:userdata_block_device:s0
/dev/block/nvme0n1p1 u:object_r:boot_block_device:s0
/dev/block/nvme0n1p2 u:object_r:system_block_device:s0
/dev/block/nvme0n1p3 u:object_r:system_block_device:s0
/dev/block/nvme0n1p4 u:object_r:userdata_block_device:s0
/dev/block/sda1 u:object_r:boot_block_device:s0
/dev/block/sda2 u:object_r:system_block_device:s0
/dev/block/sda3 u:object_r:system_block_device:s0
/dev/block/sda4 u:object_r:userdata_block_device:s0

View File

@@ -1,4 +1,4 @@
service suspend_blocker_rpi /apex/com.android.hardware.suspend_blocker.rpi5/bin/suspend_blocker_rpi service vendor.suspend_blocker-rpi /apex/com.android.hardware.suspend_blocker.rpi5/bin/suspend_blocker_rpi
class hal class hal
group system group system
user root user root