From d131f945e66f81b8c07b6fb5015c9b0b007213de Mon Sep 17 00:00:00 2001
From: Yifan Hong <elsk@google.com>
Date: Tue, 4 Apr 2017 13:44:46 -0700
Subject: [PATCH] Allow hal_sensors to use ashmem from android.hidl.allocator

android.framework.sensorservice@1.0 pass a file
descriptor from hidl_memory into
android.hardware.sensors@1.0, hence requiring the latter
to use the file descriptor.

Test: VtsHalSensorManagerV1_0TargetTest under selinux
enforcing mode
Bug: 35219747
Change-Id: I0185c8af0714776842c90ebb687b684324b55cd8
---
 public/hal_sensors.te | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/public/hal_sensors.te b/public/hal_sensors.te
index 0d6dfe077..567b0bee1 100644
--- a/public/hal_sensors.te
+++ b/public/hal_sensors.te
@@ -3,3 +3,7 @@ binder_call(hal_sensors_client, hal_sensors_server)
 
 # Allow sensor hals to access ashmem memory allocated by apps
 allow hal_sensors { appdomain -isolated_app }:fd use;
+
+# Allow sensor hals to access ashmem memory allocated by android.hidl.allocator
+# fd is passed in from framework sensorservice HAL.
+allow hal_sensors hal_allocator:fd use;
-- 
GitLab