From 187dcc4e0829a58965a9494267d15f535b1ecc6a Mon Sep 17 00:00:00 2001 From: Victor Liu Date: Thu, 27 Oct 2022 13:06:39 -0700 Subject: [PATCH] uwb: add permission for ccc ranging Bug: 255649425 Change-Id: I83ce369e52f382d76723b2b045e09607483a0a6a --- whitechapel_pro/hal_nfc_default.te | 2 ++ whitechapel_pro/property.te | 2 ++ whitechapel_pro/property_contexts | 2 ++ whitechapel_pro/uwb_vendor_app.te | 4 ++++ 4 files changed, 10 insertions(+) diff --git a/whitechapel_pro/hal_nfc_default.te b/whitechapel_pro/hal_nfc_default.te index 247ca3d7..11e0617b 100644 --- a/whitechapel_pro/hal_nfc_default.te +++ b/whitechapel_pro/hal_nfc_default.te @@ -13,3 +13,5 @@ allow hal_nfc_default uwb_data_vendor:file r_file_perms; # allow nfc to read uwb calibration file get_prop(hal_nfc_default, vendor_uwb_calibration_prop) +get_prop(hal_nfc_default, vendor_uwb_calibration_country_code) + diff --git a/whitechapel_pro/property.te b/whitechapel_pro/property.te index 2b16b5a9..d57ce902 100644 --- a/whitechapel_pro/property.te +++ b/whitechapel_pro/property.te @@ -28,6 +28,8 @@ vendor_internal_prop(vendor_fingerprint_prop) # UWB calibration system_vendor_config_prop(vendor_uwb_calibration_prop) +# Country code must be vendor_public to be written by UwbVendorService and read by NFC HAL +vendor_internal_prop(vendor_uwb_calibration_country_code) # Dynamic sensor vendor_internal_prop(vendor_dynamic_sensor_prop) diff --git a/whitechapel_pro/property_contexts b/whitechapel_pro/property_contexts index d8e3e033..5c19ed48 100644 --- a/whitechapel_pro/property_contexts +++ b/whitechapel_pro/property_contexts @@ -89,6 +89,8 @@ vendor.gf. u:object_r:vendor_fingerprint_prop:s0 #uwb ro.vendor.uwb.calibration. u:object_r:vendor_uwb_calibration_prop:s0 exact string +vendor.uwb.calibration.country_code u:object_r:vendor_uwb_calibration_country_code:s0 exact string + # Dynamic sensor vendor.dynamic_sensor. u:object_r:vendor_dynamic_sensor_prop:s0 diff --git a/whitechapel_pro/uwb_vendor_app.te b/whitechapel_pro/uwb_vendor_app.te index 364bee36..aa4564e6 100644 --- a/whitechapel_pro/uwb_vendor_app.te +++ b/whitechapel_pro/uwb_vendor_app.te @@ -16,6 +16,10 @@ allow uwb_vendor_app uwb_vendor_data_file:dir create_dir_perms; allow hal_uwb_vendor_default self:global_capability_class_set sys_nice; allow hal_uwb_vendor_default kernel:process setsched; +# UwbVendorService must be able to read USRA version from vendor_secure_element_prop get_prop(uwb_vendor_app, vendor_secure_element_prop) +# UwbVendorService must be able to write country code prop +set_prop(uwb_vendor_app, vendor_uwb_calibration_country_code) + binder_call(uwb_vendor_app, hal_uwb_vendor_default) ')