android: hal: Convert to apex

This commit is contained in:
Konsta
2025-10-30 10:47:46 +02:00
parent 14780c69ca
commit 8bf59a6bbd
5 changed files with 70 additions and 2 deletions

View File

@@ -38,6 +38,7 @@ cc_library_shared {
srcs: ["LibcameraProvider.cpp"],
export_include_dirs: ["."],
defaults: ["libcamera_aidl_defaults"],
installable: false,
}
cc_defaults {
@@ -50,6 +51,49 @@ cc_defaults {
cc_binary {
name: "android.hardware.camera.provider-V1-libcamera-service",
init_rc: ["android.hardware.camera.provider-V1-libcamera-service.rc"],
defaults: ["camera_service.libcamera_defaults"],
installable: false,
}
prebuilt_etc {
name: "android.hardware.camera.provider-V1-libcamera-service.rc",
src: "android.hardware.camera.provider-V1-libcamera-service.rc",
installable: false,
}
prebuilt_etc {
name: "android.hardware.camera.provider-V1-libcamera-service.xml",
src: "android.hardware.camera.provider-V1-libcamera-service.xml",
sub_dir: "vintf",
installable: false,
}
apex {
name: "com.android.hardware.camera.libcamera",
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-libcamera-service",
],
native_shared_libs: [
"camera.libcamera",
] + select(soong_config_variable("libcamera", "ipa"), {
"pisp": ["ipa_rpi_pisp"],
"vc4": ["ipa_rpi_vc4"],
default: [],
}),
prebuilts: [
"android.hardware.camera.provider-V1-libcamera-service.rc",
"android.hardware.camera.provider-V1-libcamera-service.xml",
"backend_default_config.json",
] + select(soong_config_variable("libcamera", "ipa"), {
"pisp": ["libcamera-rpi-ipa_rpi_pisp_data"],
"vc4": ["libcamera-rpi-ipa_rpi_vc4_data"],
default: [],
}),
}

View File

@@ -1,4 +1,8 @@
service vendor.camera.provider-libcamera /vendor/bin/hw/android.hardware.camera.provider-V1-libcamera-service
on property:apex.all.ready=true
setprop ro.hardware.camera libcamera
start vendor.camera.provider-libcamera
service vendor.camera.provider-libcamera /apex/com.android.hardware.camera.libcamera/bin/hw/android.hardware.camera.provider-V1-libcamera-service
interface aidl android.hardware.camera.provider.ICameraProvider/libcamera/0
class hal
user cameraserver
@@ -6,5 +10,8 @@ service vendor.camera.provider-libcamera /vendor/bin/hw/android.hardware.camera.
ioprio rt 4
capabilities SYS_NICE
task_profiles CameraServiceCapacity MaxPerformance
setenv LIBCAMERA_IPA_CONFIG_PATH /apex/com.android.hardware.camera.libcamera/etc/libcamera/ipa/
setenv LIBCAMERA_IPA_MODULE_PATH /apex/com.android.hardware.camera.libcamera/lib64/libcamera/ipa/
setenv LIBCAMERA_LOG_LEVELS *:WARN
setenv LIBCAMERA_LOG_FILE syslog
disabled

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>libcamera/0</instance>
</interface>
</hal>
</manifest>

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-libcamera-service u:object_r:hal_camera_default_exec:s0

View File

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