From 64bc40748cbe2f60aa6e46b7c4a555c54b7b9d07 Mon Sep 17 00:00:00 2001 From: Rohit Sekhar Date: Fri, 17 Jan 2025 12:45:12 +0530 Subject: [PATCH 1/3] FP4: haxx vendor.debug.camera.pkgname -> debug.camera.packagename * Drop the build.prop override, since we will set the property dynamically from cameraserver anyways --- extract-files.sh | 12 ++++++++++++ vendor.prop | 3 --- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/extract-files.sh b/extract-files.sh index 6d6fef7..b23028b 100644 --- a/extract-files.sh +++ b/extract-files.sh @@ -64,6 +64,18 @@ function blob_fixup() { vendor/lib64/vendor.qti.hardware.camera.postproc@1.0-service-impl.bitra.so) "${SIGSCAN}" -p "13 0a 00 94" -P "1F 20 03 D5" -f "${2}" ;; + vendor/lib64/camera/components/com.qti.node.gpu.so) + sed -i 's|vendor.debug.camera.pkgname|debug.camera.packagename\x00\x00\x00|g' "${2}" + ;; + vendor/lib64/hw/camera.qcom.so) + sed -i 's|vendor.debug.camera.pkgname|debug.camera.packagename\x00\x00\x00|g' "${2}" + ;; + vendor/lib64/hw/com.qti.chi.override.bitra.so) + sed -i 's|vendor.debug.camera.pkgname|debug.camera.packagename\x00\x00\x00|g' "${2}" + ;; + vendor/lib64/hw/com.qti.chi.override.so) + sed -i 's|vendor.debug.camera.pkgname|debug.camera.packagename\x00\x00\x00|g' "${2}" + ;; vendor/lib64/hw/fingerprint.lito.so) sed -i 's|fpsensor_fingerprint\x00|fingerprint\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00|g' "${2}" ;; diff --git a/vendor.prop b/vendor.prop index f5eeba0..ff88f38 100644 --- a/vendor.prop +++ b/vendor.prop @@ -108,9 +108,6 @@ persist.vendor.dpmhalservice.enable=1 # FM vendor.hw.fm.init=0 -# FPCamera -vendor.debug.camera.pkgname=com.fp.camera - # FRP ro.frp.pst=/dev/block/bootdevice/by-name/frp -- GitLab From 24f706816dee3e44bc8f127e389eaec1e5b3c6e9 Mon Sep 17 00:00:00 2001 From: Rohit Sekhar Date: Fri, 17 Jan 2025 12:46:53 +0530 Subject: [PATCH 2/3] FP4: Allow debug.camera.packagename to be set and read --- BoardConfig.mk | 1 + sepolicy/private/property_contexts | 5 ++++- sepolicy/public/property.te | 2 ++ sepolicy/vendor/cameraserver.te | 1 + sepolicy/vendor/hal_camera.te | 1 + 5 files changed, 9 insertions(+), 1 deletion(-) create mode 100644 sepolicy/public/property.te create mode 100644 sepolicy/vendor/cameraserver.te create mode 100644 sepolicy/vendor/hal_camera.te diff --git a/BoardConfig.mk b/BoardConfig.mk index 760fc01..74b8ecc 100644 --- a/BoardConfig.mk +++ b/BoardConfig.mk @@ -173,6 +173,7 @@ VENDOR_SECURITY_PATCH := 2024-07-05 include device/qcom/sepolicy_vndr/SEPolicy.mk BOARD_VENDOR_SEPOLICY_DIRS += $(DEVICE_PATH)/sepolicy/vendor SYSTEM_EXT_PRIVATE_SEPOLICY_DIRS += $(DEVICE_PATH)/sepolicy/private +SYSTEM_EXT_PUBLIC_SEPOLICY_DIRS += $(DEVICE_PATH)/sepolicy/public # Verified Boot BOARD_AVB_ENABLE := true diff --git a/sepolicy/private/property_contexts b/sepolicy/private/property_contexts index e3ea0fc..c27bf34 100644 --- a/sepolicy/private/property_contexts +++ b/sepolicy/private/property_contexts @@ -1,2 +1,5 @@ +# Camera +debug.camera.packagename u:object_r:debug_camera_prop:s0 + # Radio -persist.ril.sim.mcc.mnc u:object_r:radio_prop:s0 +persist.ril.sim.mcc.mnc u:object_r:radio_prop:s0 diff --git a/sepolicy/public/property.te b/sepolicy/public/property.te new file mode 100644 index 0000000..0334ca2 --- /dev/null +++ b/sepolicy/public/property.te @@ -0,0 +1,2 @@ +# Camera +system_public_prop(debug_camera_prop) diff --git a/sepolicy/vendor/cameraserver.te b/sepolicy/vendor/cameraserver.te new file mode 100644 index 0000000..c730fb4 --- /dev/null +++ b/sepolicy/vendor/cameraserver.te @@ -0,0 +1 @@ +set_prop(cameraserver, debug_camera_prop) diff --git a/sepolicy/vendor/hal_camera.te b/sepolicy/vendor/hal_camera.te new file mode 100644 index 0000000..e0ceab4 --- /dev/null +++ b/sepolicy/vendor/hal_camera.te @@ -0,0 +1 @@ +get_prop(hal_camera, debug_camera_prop) -- GitLab From f4c9e34d9288215462231cf46c9bff784981aa5f Mon Sep 17 00:00:00 2001 From: Rohit Sekhar Date: Fri, 17 Jan 2025 13:23:12 +0530 Subject: [PATCH 3/3] FP4: Set TARGET_CAMERA_EXPOSE_CLIENTPKGNAME -> true * Fairphone customizes the camera stack based on the client pkgname * We had this forced to FPCamera package name to unbreak features there * Setting this dynamically, fixes QR code scanning in Opera --- BoardConfig.mk | 1 + 1 file changed, 1 insertion(+) diff --git a/BoardConfig.mk b/BoardConfig.mk index 74b8ecc..b76161f 100644 --- a/BoardConfig.mk +++ b/BoardConfig.mk @@ -51,6 +51,7 @@ BOARD_SUPPORTS_SOUND_TRIGGER := true TARGET_BOOTLOADER_BOARD_NAME := FP4 # Camera +TARGET_CAMERA_EXPOSE_CLIENTPKGNAME := true TARGET_CAMERA_OVERRIDE_FORMAT_FROM_RESERVED := true # Display -- GitLab