nfc: sepolicy: creates data/vendor/nfc/ for HAL specific data

Test: NFC powers up without any denials
Bug: 36686703
Change-Id: Ib33a0042c5d03d2b9ee8a02dac143da9c8c216a9
Signed-off-by: Ruchi Kandoi<kandoiruchi@google.com>
diff --git a/init.common.rc b/init.common.rc
index 1adc68f..fdb508f 100644
--- a/init.common.rc
+++ b/init.common.rc
@@ -289,6 +289,7 @@
 
     # NFC local data and nfcee xml storage
     mkdir /data/nfc 0770 nfc nfc
+    mkdir /data/vendor/nfc 0770 nfc nfc
     mkdir /data/nfc/param 0770 nfc nfc
 
     # Create IOP deamon related dirs
diff --git a/sepolicy/file.te b/sepolicy/file.te
index c78a4c7..d37b354 100644
--- a/sepolicy/file.te
+++ b/sepolicy/file.te
@@ -16,6 +16,7 @@
 type nanohub_lock_file, file_type, data_file_type;
 type sensors_cal_file, file_type;
 type sensors_saved_settings_file, file_type, data_file_type;
+type nfc_vendor_data_file, file_type, data_file_type;
 
 # /sys
 type sysfs_camera, sysfs_type, fs_type;
diff --git a/sepolicy/file_contexts b/sepolicy/file_contexts
index 799b582..81fe41c 100644
--- a/sepolicy/file_contexts
+++ b/sepolicy/file_contexts
@@ -197,6 +197,7 @@
 /data/misc/netmgr(/.*)?          u:object_r:netmgr_data_file:s0
 /data/system/nanohub_lock(/.*)?  u:object_r:nanohub_lock_file:s0
 /data/misc/sensorcal_saved\.json  u:object_r:sensors_saved_settings_file:s0
+/data/vendor/nfc(/.*)?           u:object_r:nfc_vendor_data_file:s0
 
 
 # /
diff --git a/sepolicy/hal_nfc_default.te b/sepolicy/hal_nfc_default.te
new file mode 100644
index 0000000..3044f1d
--- /dev/null
+++ b/sepolicy/hal_nfc_default.te
@@ -0,0 +1,3 @@
+# Data file accesses.
+allow hal_nfc_default nfc_vendor_data_file:dir create_dir_perms;
+allow hal_nfc_default nfc_vendor_data_file:file create_file_perms;