From 08303135d2adfbbac83a01253578ce9589fe03db Mon Sep 17 00:00:00 2001 From: Konsta Date: Fri, 21 Mar 2025 23:22:23 +0200 Subject: [PATCH] hdmi: connection: convert to apex --- device.mk | 2 +- hdmi/connection/Android.bp | 32 +++++++++++++++++-- ...hardware.tv.hdmi.connection-service.rpi.rc | 2 +- hdmi/connection/apex_file_contexts | 3 ++ hdmi/connection/apex_manifest.json | 4 +++ sepolicy/file_contexts | 1 - 6 files changed, 39 insertions(+), 5 deletions(-) create mode 100644 hdmi/connection/apex_file_contexts create mode 100644 hdmi/connection/apex_manifest.json diff --git a/device.mk b/device.mk index 1d410ef..eb1a236 100644 --- a/device.mk +++ b/device.mk @@ -139,7 +139,7 @@ PRODUCT_COPY_FILES += \ # CEC PRODUCT_PACKAGES += \ com.android.hardware.tv.hdmi.cec.rpi4 \ - android.hardware.tv.hdmi.connection-service.rpi + com.android.hardware.tv.hdmi.connection.rpi4 PRODUCT_COPY_FILES += \ frameworks/native/data/etc/android.hardware.hdmi.cec.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.hdmi.cec.xml diff --git a/hdmi/connection/Android.bp b/hdmi/connection/Android.bp index 9b2a684..36ed547 100644 --- a/hdmi/connection/Android.bp +++ b/hdmi/connection/Android.bp @@ -6,8 +6,6 @@ cc_binary { name: "android.hardware.tv.hdmi.connection-service.rpi", relative_install_path: "hw", - init_rc: ["android.hardware.tv.hdmi.connection-service.rpi.rc"], - vintf_fragments: ["android.hardware.tv.hdmi.connection-service.rpi.xml"], vendor: true, srcs: [ "HdmiConnection.cpp", @@ -19,4 +17,34 @@ cc_binary { "libbinder_ndk", "liblog", ], + installable: false, +} + +prebuilt_etc { + name: "android.hardware.tv.hdmi.connection-service.rpi.rc", + src: "android.hardware.tv.hdmi.connection-service.rpi.rc", + installable: false, +} + +prebuilt_etc { + name: "android.hardware.tv.hdmi.connection-service.rpi.xml", + src: "android.hardware.tv.hdmi.connection-service.rpi.xml", + sub_dir: "vintf", + installable: false, +} + +apex { + name: "com.android.hardware.tv.hdmi.connection.rpi4", + 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.tv.hdmi.connection-service.rpi"], + prebuilts: [ + "android.hardware.tv.hdmi.connection-service.rpi.rc", + "android.hardware.tv.hdmi.connection-service.rpi.xml", + ], } diff --git a/hdmi/connection/android.hardware.tv.hdmi.connection-service.rpi.rc b/hdmi/connection/android.hardware.tv.hdmi.connection-service.rpi.rc index 7087f19..6f1248b 100644 --- a/hdmi/connection/android.hardware.tv.hdmi.connection-service.rpi.rc +++ b/hdmi/connection/android.hardware.tv.hdmi.connection-service.rpi.rc @@ -1,4 +1,4 @@ -service vendor.hdmi-default /vendor/bin/hw/android.hardware.tv.hdmi.connection-service.rpi +service vendor.hdmi-rpi /apex/com.android.hardware.tv.hdmi.connection.rpi4/bin/hw/android.hardware.tv.hdmi.connection-service.rpi interface aidl android.hardware.tv.hdmi.connection.IHdmiConnection/default class hal user system diff --git a/hdmi/connection/apex_file_contexts b/hdmi/connection/apex_file_contexts new file mode 100644 index 0000000..2fb1dd5 --- /dev/null +++ b/hdmi/connection/apex_file_contexts @@ -0,0 +1,3 @@ +(/.*)? u:object_r:vendor_file:s0 +/etc(/.*)? u:object_r:vendor_configs_file:s0 +/bin/hw/android\.hardware\.tv\.hdmi\.connection-service\.rpi u:object_r:hal_tv_hdmi_connection_default_exec:s0 diff --git a/hdmi/connection/apex_manifest.json b/hdmi/connection/apex_manifest.json new file mode 100644 index 0000000..586c5e2 --- /dev/null +++ b/hdmi/connection/apex_manifest.json @@ -0,0 +1,4 @@ +{ + "name": "com.android.hardware.tv.hdmi.connection.rpi4", + "version": 1 +} diff --git a/sepolicy/file_contexts b/sepolicy/file_contexts index 65fb49c..e7b7851 100644 --- a/sepolicy/file_contexts +++ b/sepolicy/file_contexts @@ -6,7 +6,6 @@ /dev/cec1 u:object_r:cec_device:s0 /sys/devices/platform/gpu/drm/card0/card0-HDMI-A-1/status u:object_r:sysfs_hdmi:s0 /sys/devices/platform/gpu/drm/card0/card0-HDMI-A-2/status u:object_r:sysfs_hdmi:s0 -/vendor/bin/hw/android\.hardware\.tv\.hdmi\.connection-service\.rpi u:object_r:hal_tv_hdmi_connection_default_exec:s0 # DRM /data/vendor/mediadrm(/.*)? u:object_r:mediadrm_vendor_data_file:s0