From fcdd354653d3c37baa68fc33a2a4854007153a2c Mon Sep 17 00:00:00 2001
From: Casper Bonde <c.bonde@samsung.com>
Date: Thu, 19 Mar 2015 10:56:26 +0100
Subject: [PATCH] Add permission for Bluetooth Sim Access Profile

Added permission to SAP socket used to access the the RIL daemon

Change-Id: Ifbfb764f0b8731e81fb3157955aa4fda6120d846
Signed-off-by: Casper Bonde <c.bonde@samsung.com>
---
 bluetooth.te  | 4 ++++
 file.te       | 2 +-
 file_contexts | 1 +
 3 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/bluetooth.te b/bluetooth.te
index 2b108a9e8..5541f6811 100644
--- a/bluetooth.te
+++ b/bluetooth.te
@@ -49,6 +49,10 @@ allow bluetooth bluetooth_prop:property_service set;
 allow bluetooth pan_result_prop:property_service set;
 allow bluetooth ctl_dhcp_pan_prop:property_service set;
 
+# Bluetooth Sim Access Profile Socket to the RIL
+unix_socket_connect(bluetooth, sap_uim, rild)
+
+
 ###
 ### Neverallow rules
 ###
diff --git a/file.te b/file.te
index 9e56d7f65..9a7230ca2 100644
--- a/file.te
+++ b/file.te
@@ -155,7 +155,7 @@ type system_ndebug_socket, file_type;
 type vold_socket, file_type;
 type wpa_socket, file_type;
 type zygote_socket, file_type;
-
+type sap_uim_socket, file_type;
 # UART (for GPS) control proc file
 type gps_control, file_type;
 
diff --git a/file_contexts b/file_contexts
index 62802e0a9..30fd9e3f1 100644
--- a/file_contexts
+++ b/file_contexts
@@ -77,6 +77,7 @@
 /dev/snd(/.*)?		u:object_r:audio_device:s0
 /dev/socket(/.*)?	u:object_r:socket_device:s0
 /dev/socket/adbd	u:object_r:adbd_socket:s0
+/dev/socket/sap_uim_socket[0-9]        u:object_r:sap_uim_socket:s0
 /dev/socket/dnsproxyd	u:object_r:dnsproxyd_socket:s0
 /dev/socket/dumpstate	u:object_r:dumpstate_socket:s0
 /dev/socket/fwmarkd	u:object_r:fwmarkd_socket:s0
-- 
GitLab