From ea5ec69b7975aa2419f48e8b974a482e12712ba8 Mon Sep 17 00:00:00 2001 From: Ravi Jain Date: Mon, 15 Apr 2024 03:49:41 +0000 Subject: [PATCH 1/3] touch: moving ical related sepolicies to independent folder Bug: 331139251 Test: Manually verify the result. Change-Id: I53b5c8eb73f1ce775ec83a06b43c0b4993f31e69 --- touch/gti/gti.mk | 1 + touch/gti/gti_dual.mk | 1 + touch/gti/ical/sepolicy/file_contexts | 1 + touch/gti/{ => ical}/sepolicy/gti_ical.te | 0 touch/gti/{ => ical}/sepolicy/property.te | 0 touch/gti/{ => ical}/sepolicy/property_contexts | 0 touch/gti/{ => ical}/sepolicy/vendor_init.te | 0 touch/gti/{ => ical}/sepolicy_gti_dual/property_contexts | 0 touch/gti/sepolicy/file_contexts | 1 - 9 files changed, 3 insertions(+), 1 deletion(-) create mode 100644 touch/gti/ical/sepolicy/file_contexts rename touch/gti/{ => ical}/sepolicy/gti_ical.te (100%) rename touch/gti/{ => ical}/sepolicy/property.te (100%) rename touch/gti/{ => ical}/sepolicy/property_contexts (100%) rename touch/gti/{ => ical}/sepolicy/vendor_init.te (100%) rename touch/gti/{ => ical}/sepolicy_gti_dual/property_contexts (100%) diff --git a/touch/gti/gti.mk b/touch/gti/gti.mk index a2c7cf7..2aab821 100644 --- a/touch/gti/gti.mk +++ b/touch/gti/gti.mk @@ -1,4 +1,5 @@ BOARD_VENDOR_SEPOLICY_DIRS += device/google/gs-common/touch/gti/sepolicy +BOARD_VENDOR_SEPOLICY_DIRS += device/google/gs-common/touch/gti/ical/sepolicy PRODUCT_PACKAGES += dump_gti0.sh PRODUCT_PACKAGES += touch_gti_ical diff --git a/touch/gti/gti_dual.mk b/touch/gti/gti_dual.mk index f56645d..d6b7602 100644 --- a/touch/gti/gti_dual.mk +++ b/touch/gti/gti_dual.mk @@ -1,5 +1,6 @@ include device/google/gs-common/touch/gti/gti.mk BOARD_VENDOR_SEPOLICY_DIRS += device/google/gs-common/touch/gti/sepolicy_gti_dual +BOARD_VENDOR_SEPOLICY_DIRS += device/google/gs-common/touch/gti/ical/sepolicy_gti_dual PRODUCT_PACKAGES += dump_gti1.sh diff --git a/touch/gti/ical/sepolicy/file_contexts b/touch/gti/ical/sepolicy/file_contexts new file mode 100644 index 0000000..9bd59c3 --- /dev/null +++ b/touch/gti/ical/sepolicy/file_contexts @@ -0,0 +1 @@ +/vendor/bin/touch_gti_ical u:object_r:gti_ical_exec:s0 diff --git a/touch/gti/sepolicy/gti_ical.te b/touch/gti/ical/sepolicy/gti_ical.te similarity index 100% rename from touch/gti/sepolicy/gti_ical.te rename to touch/gti/ical/sepolicy/gti_ical.te diff --git a/touch/gti/sepolicy/property.te b/touch/gti/ical/sepolicy/property.te similarity index 100% rename from touch/gti/sepolicy/property.te rename to touch/gti/ical/sepolicy/property.te diff --git a/touch/gti/sepolicy/property_contexts b/touch/gti/ical/sepolicy/property_contexts similarity index 100% rename from touch/gti/sepolicy/property_contexts rename to touch/gti/ical/sepolicy/property_contexts diff --git a/touch/gti/sepolicy/vendor_init.te b/touch/gti/ical/sepolicy/vendor_init.te similarity index 100% rename from touch/gti/sepolicy/vendor_init.te rename to touch/gti/ical/sepolicy/vendor_init.te diff --git a/touch/gti/sepolicy_gti_dual/property_contexts b/touch/gti/ical/sepolicy_gti_dual/property_contexts similarity index 100% rename from touch/gti/sepolicy_gti_dual/property_contexts rename to touch/gti/ical/sepolicy_gti_dual/property_contexts diff --git a/touch/gti/sepolicy/file_contexts b/touch/gti/sepolicy/file_contexts index 37e3733..2fce7f5 100644 --- a/touch/gti/sepolicy/file_contexts +++ b/touch/gti/sepolicy/file_contexts @@ -1,2 +1 @@ /vendor/bin/dump/dump_gti0\.sh u:object_r:dump_gti_exec:s0 -/vendor/bin/touch_gti_ical u:object_r:gti_ical_exec:s0 From 1a2d7ae821ee87f95fb412efcdea99089449ebb9 Mon Sep 17 00:00:00 2001 From: Chienyuan Huang Date: Fri, 12 Apr 2024 06:40:48 +0000 Subject: [PATCH 2/3] Add Bluetooth Ranging HAL Bug: 333984281 Test: Manual Change-Id: Id4877463d5e465e91a8e321ffc6fe0cb07390ebd --- bcmbt/bluetooth.mk | 1 + bcmbt/manifest_bluetooth.xml | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/bcmbt/bluetooth.mk b/bcmbt/bluetooth.mk index 49c52c0..af4cf99 100644 --- a/bcmbt/bluetooth.mk +++ b/bcmbt/bluetooth.mk @@ -2,6 +2,7 @@ PRODUCT_SOONG_NAMESPACES += vendor/broadcom/bluetooth PRODUCT_PACKAGES += \ android.hardware.bluetooth-V1-ndk.so \ android.hardware.bluetooth.finder-V1-ndk.so \ + android.hardware.bluetooth.ranging-V1-ndk.so \ android.hardware.bluetooth-service.bcmbtlinux \ vendor.google.bluetooth_ext-V1-ndk.so \ bt_vendor.conf \ diff --git a/bcmbt/manifest_bluetooth.xml b/bcmbt/manifest_bluetooth.xml index 9401d71..a72f1c9 100644 --- a/bcmbt/manifest_bluetooth.xml +++ b/bcmbt/manifest_bluetooth.xml @@ -9,6 +9,11 @@ 1 IBluetoothFinder/default + + android.hardware.bluetooth.ranging + 1 + IBluetoothChannelSounding/default + vendor.google.bluetooth_ext 1 From d7c33cef92c4f354e46947622bcdf548d9c9797e Mon Sep 17 00:00:00 2001 From: samou Date: Mon, 15 Apr 2024 13:27:11 +0000 Subject: [PATCH 3/3] sepolicy: allow dumpstate to call battery_mitigation Bug: 322141931 Change-Id: I5a6d013df754d3f6d6e9d1ee3ea335176450069b Signed-off-by: samou --- battery_mitigation/sepolicy/vendor/battery_mitigation.te | 3 +++ battery_mitigation/sepolicy/vendor/dumpstate.te | 3 +++ battery_mitigation/sepolicy/vendor/service.te | 2 +- 3 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 battery_mitigation/sepolicy/vendor/dumpstate.te diff --git a/battery_mitigation/sepolicy/vendor/battery_mitigation.te b/battery_mitigation/sepolicy/vendor/battery_mitigation.te index 3133ab5..30b314c 100644 --- a/battery_mitigation/sepolicy/vendor/battery_mitigation.te +++ b/battery_mitigation/sepolicy/vendor/battery_mitigation.te @@ -24,6 +24,8 @@ allow battery_mitigation sysfs_bcl:lnk_file r_file_perms; allow battery_mitigation sysfs_thermal:lnk_file r_file_perms; allow battery_mitigation mitigation_vendor_data_file:dir rw_dir_perms; allow battery_mitigation mitigation_vendor_data_file:file create_file_perms; +allow battery_mitigation dumpstate:fd use; +allow battery_mitigation dumpstate:fifo_file rw_file_perms; # Allow battery_mitigation to use Binder IPC so that service manager can notify it for callbacks binder_use(battery_mitigation) @@ -33,3 +35,4 @@ wakelock_use(battery_mitigation) add_service(battery_mitigation, hal_battery_mitigation_service) # Allow battery_mitigation to run audio mitigation callback binder_call(battery_mitigation, hal_audio_default) +binder_call(battery_mitigation, servicemanager) diff --git a/battery_mitigation/sepolicy/vendor/dumpstate.te b/battery_mitigation/sepolicy/vendor/dumpstate.te new file mode 100644 index 0000000..b3bb1d4 --- /dev/null +++ b/battery_mitigation/sepolicy/vendor/dumpstate.te @@ -0,0 +1,3 @@ +# To call battery_mitigation hal +allow dumpstate hal_battery_mitigation_service:service_manager find; +binder_call(dumpstate, battery_mitigation); diff --git a/battery_mitigation/sepolicy/vendor/service.te b/battery_mitigation/sepolicy/vendor/service.te index 3ffe254..f0c7e9d 100644 --- a/battery_mitigation/sepolicy/vendor/service.te +++ b/battery_mitigation/sepolicy/vendor/service.te @@ -1 +1 @@ -type hal_battery_mitigation_service, protected_service, hal_service_type, service_manager_type; +type hal_battery_mitigation_service, hal_service_type, service_manager_type;