Add android property vendor.edgetpu.tflite_delegate.force_disable_io_coherency

because we need it for DarwinnDelegate to forcelly disable the cache coherency feature for debugging purpose. This sys prop should be readable by all Darwinn Delegate clients, but only modifiable by `adb root`.

Test: Verified that both camera app and camera HAL can read the flag. See pending CL cl/507001854 and android_flag_permission_test.md

Bug: 262420821
Change-Id: I0ae7e02f1d4805956a05afeb92f892cbac6d5213
This commit is contained in:
feiyuchen 2023-01-22 09:55:25 +00:00
parent c148039051
commit 1fa64096e9
7 changed files with 17 additions and 0 deletions

View File

@ -25,3 +25,6 @@ PRODUCT_PACKAGES += com.google.edgetpu.dba-service
PRODUCT_PACKAGES += libedgetpu_dba.google
BOARD_VENDOR_SEPOLICY_DIRS += device/google/gs-common/edgetpu/sepolicy
# Tflite Darwinn delegate property
PRODUCT_VENDOR_PROPERTIES += vendor.edgetpu.tflite_delegate.force_disable_io_coherency=1

View File

@ -0,0 +1,2 @@
# Allow apps to read tflite Darwinn delegate properties
get_prop(appdomain, vendor_tflite_delegate_prop)

View File

@ -36,3 +36,6 @@ allow edgetpu_dba_server proc_version:file r_file_perms;
# Allow EdgeTPU DBA service to send trace packets to Perfetto with SELinux enabled
# under userdebug builds.
userdebug_or_eng(`perfetto_producer(edgetpu_dba_server)')
# Allow EdgeTPU DBA service to read tflite Darwinn delegate properties
get_prop(edgetpu_dba_server, vendor_tflite_delegate_prop)

View File

@ -0,0 +1,2 @@
# Allow camera HAL to read tflite Darwinn delegate properties
get_prop(hal_camera_default, vendor_tflite_delegate_prop)

View File

@ -2,3 +2,6 @@
# since it lives under /system_ext/.
system_public_prop(vendor_edgetpu_service_prop)
# Tflite Darwinn delegate properties are written once by vendor_init,
# and then read by apps, camera hal, and some Darwinn vendor services.
system_vendor_config_prop(vendor_tflite_delegate_prop)

View File

@ -1,3 +1,5 @@
# for EdgeTPU
vendor.edgetpu.service. u:object_r:vendor_edgetpu_service_prop:s0
# for DarwinnDelegate
vendor.edgetpu.tflite_delegate. u:object_r:vendor_tflite_delegate_prop:s0

View File

@ -0,0 +1,2 @@
# Allow vendor_init to set tflite Darwinn delegate properties
set_prop(vendor_init, vendor_tflite_delegate_prop)