2017-09-26 21:58:29 +02:00
|
|
|
# HwBinder IPC from client to server, and callbacks
|
|
|
|
binder_call(hal_neuralnetworks_client, hal_neuralnetworks_server)
|
|
|
|
binder_call(hal_neuralnetworks_server, hal_neuralnetworks_client)
|
|
|
|
|
2018-06-06 18:30:18 +02:00
|
|
|
hal_attribute_hwservice(hal_neuralnetworks, hal_neuralnetworks_hwservice)
|
2017-09-26 21:58:29 +02:00
|
|
|
allow hal_neuralnetworks hidl_memory_hwservice:hwservice_manager find;
|
|
|
|
allow hal_neuralnetworks hal_allocator:fd use;
|
2020-02-21 19:53:09 +01:00
|
|
|
allow hal_neuralnetworks hal_graphics_mapper_hwservice:hwservice_manager find;
|
|
|
|
allow hal_neuralnetworks hal_graphics_allocator:fd use;
|
2018-12-08 02:24:24 +01:00
|
|
|
|
|
|
|
# Allow NN HAL service to use a client-provided fd residing in /data/data/.
|
|
|
|
allow hal_neuralnetworks_server app_data_file:file { read write getattr map };
|
2019-04-25 01:44:41 +02:00
|
|
|
allow hal_neuralnetworks_server privapp_data_file:file { read write getattr map };
|
2018-12-08 02:24:24 +01:00
|
|
|
|
|
|
|
# Allow NN HAL service to use a client-provided fd residing in /data/local/tmp/.
|
|
|
|
allow hal_neuralnetworks_server shell_data_file:file { read write getattr map };
|
2019-04-02 16:34:16 +02:00
|
|
|
|
2020-02-21 19:53:09 +01:00
|
|
|
# Allow NN HAL service to read a client-provided ION memory fd.
|
|
|
|
allow hal_neuralnetworks_server ion_device:chr_file r_file_perms;
|
|
|
|
|
2020-04-23 18:04:05 +02:00
|
|
|
# Allow NN HAL service to use a client-provided fd residing in /storage
|
|
|
|
allow hal_neuralnetworks_server storage_file:file { getattr map read };
|
|
|
|
|
2021-04-17 01:34:57 +02:00
|
|
|
# Allow NN HAL service to read a client-provided fd residing in /data/app/.
|
|
|
|
allow hal_neuralnetworks_server apk_data_file:file { getattr map read };
|
|
|
|
|
2019-04-02 16:34:16 +02:00
|
|
|
# Allow NN HAL client to check the ro.nnapi.extensions.deny_on_product
|
|
|
|
# property to determine whether to deny NNAPI extensions use for apps
|
|
|
|
# on product partition (apps in GSI are not allowed to use NNAPI extensions).
|
|
|
|
get_prop(hal_neuralnetworks_client, nnapi_ext_deny_product_prop);
|
2021-10-05 16:23:18 +02:00
|
|
|
|
|
|
|
# Allow NN HAL client to read device_config_nnapi_native_prop.
|
|
|
|
get_prop(hal_neuralnetworks_client, device_config_nnapi_native_prop)
|
|
|
|
|
2019-04-02 16:34:16 +02:00
|
|
|
# This property is only expected to be found in /product/build.prop,
|
|
|
|
# allow to be set only by init.
|
|
|
|
neverallow { domain -init } nnapi_ext_deny_product_prop:property_service set;
|
2021-01-19 16:23:51 +01:00
|
|
|
|
|
|
|
# Define sepolicy for NN AIDL HAL service
|
|
|
|
hal_attribute_service(hal_neuralnetworks, hal_neuralnetworks_service)
|
|
|
|
binder_call(hal_neuralnetworks_server, servicemanager)
|
|
|
|
|
2021-04-14 01:27:19 +02:00
|
|
|
binder_use(hal_neuralnetworks_server)
|
|
|
|
|
2021-01-19 16:23:51 +01:00
|
|
|
allow hal_neuralnetworks_server dumpstate:fifo_file write;
|