[ALPS03953773] Audio: Add permission for SmartPA calibration

Add permission for SmartPA calibration in factory
mode, otherwise it will encounter avc denied in
SmartPA calibration test case.
mtk_audiohal_data_file:dir { read search open } is
merged to mtk_audiohal_data_file:dir create_dir_perms.

MTK-Commit-Id: e26e9c0120f4907d966986cc50c4d964ae816c98

Change-Id: I38c25d06426afcc2f83b4ee646cba510dde71817
CR-Id: ALPS03953773
Feature: DSP SmartPA
diff --git a/non_plat/factory.te b/non_plat/factory.te
index f5ed4ee..399f655 100644
--- a/non_plat/factory.te
+++ b/non_plat/factory.te
@@ -323,7 +323,6 @@
 # For Audio device permission
 allow factory proc_asound:dir { read search open };
 allow factory proc_asound:file { read open getattr write };
-allow factory mtk_audiohal_data_file:dir { read search open };
 allow factory audiohal_prop:property_service set;
 
 # For Accdet data permission
@@ -362,3 +361,10 @@
 # Purpose : Refine policy
 allow factory sysfs_mmcblk:dir { search };
 allow factory sysfs_mmcblk:file { read getattr open };
+
+# Date : WK18.37
+# Operation: P migration
+# Purpose : ADSP SmartPA calibration
+allow factory vendor_file:file execute_no_trans;
+allow factory mtk_audiohal_data_file:dir create_dir_perms;
+allow factory mtk_audiohal_data_file:file { write create unlink r_file_perms };
diff --git a/non_plat/kernel.te b/non_plat/kernel.te
index 79bfdd4..0b33f40 100644
--- a/non_plat/kernel.te
+++ b/non_plat/kernel.te
@@ -76,6 +76,7 @@
 # Operation: SQC
 # Purpose: Allow SCP SmartPA kthread to write debug dump to sdcard
 allow kernel mtk_hal_audio:fd use;
+allow kernel factory:fd use;
 
 # Date : WK18.29
 # Operation: SQC