Snap for 8701348 from 1313623b2e0361f37847a554d5327e1f785390c1 to mainline-uwb-release
Change-Id: I01eaebb4f3bd276e935c3e49df0a41effbdc9795
diff --git a/vendor/google/file.te b/vendor/google/file.te
index 746318e..9df566d 100644
--- a/vendor/google/file.te
+++ b/vendor/google/file.te
@@ -67,6 +67,7 @@
# Darwinn HAL shared files.
type hal_neuralnetworks_darwinn_hal_camera_data_file, file_type, data_file_type;
type proc_sched_lib_mask_cpuinfo, proc_type, fs_type;
+type sysfs_limit_power_transfer, sysfs_type, fs_type;
# Directory for camera autocalibration files
type camera_calibration_vendor_data_file, file_type, data_file_type;
diff --git a/vendor/google/file_contexts b/vendor/google/file_contexts
index 77f20b9..025965d 100644
--- a/vendor/google/file_contexts
+++ b/vendor/google/file_contexts
@@ -26,7 +26,8 @@
/vendor/bin/hw/android\.hardware\.contexthub@1\.2-service\.generic u:object_r:hal_contexthub_default_exec:s0
/vendor/bin/hw/android\.hardware\.neuralnetworks@1\.2-service-noronha u:object_r:hal_neuralnetworks_darwinn_exec:s0
/vendor/bin/hw/android\.hardware\.power\.stats@1\.0-service\.pixel u:object_r:hal_power_stats_default_exec:s0
-/vendor/bin/hw/android\.hardware\.usb@1\.3-service\.coral u:object_r:hal_usb_impl_exec:s0
+/vendor/bin/hw/android\.hardware\.usb-service\.coral u:object_r:hal_usb_impl_exec:s0
+/vendor/bin/hw/android\.hardware\.usb\.gadget-service\.coral u:object_r:hal_usb_gadget_impl_exec:s0
/vendor/bin/hw/hardware\.google\.light@1\.1-service u:object_r:hal_light_default_exec:s0
/vendor/bin/hw/vendor\.google\.airbrush@1\.0-service u:object_r:airbrush_exec:s0
/vendor/bin/hw/vendor\.google\.radioext@1\.0-service u:object_r:hal_radioext_default_exec:s0
diff --git a/vendor/google/genfs_contexts b/vendor/google/genfs_contexts
index 2cca234..9fa146f 100644
--- a/vendor/google/genfs_contexts
+++ b/vendor/google/genfs_contexts
@@ -109,6 +109,9 @@
genfscon debugfs /regmap/1-000b/ u:object_r:debugfs_batteryinfo:s0
genfscon debugfs /regmap/2-0036/ u:object_r:debugfs_batteryinfo:s0
genfscon debugfs /regmap/2-000b/ u:object_r:debugfs_batteryinfo:s0
+genfscon sysfs /devices/platform/soc/c440000.qcom,spmi/spmi-0/spmi0-02/c440000.qcom,spmi:qcom,pm8150b@2:qcom,usb-pdphy@1700/usbpd0/usb_limit_sink_current u:object_r:sysfs_limit_power_transfer:s0
+genfscon sysfs /devices/platform/soc/c440000.qcom,spmi/spmi-0/spmi0-02/c440000.qcom,spmi:qcom,pm8150b@2:qcom,usb-pdphy@1700/usbpd0/usb_limit_sink_enable u:object_r:sysfs_limit_power_transfer:s0
+genfscon sysfs /devices/platform/soc/c440000.qcom,spmi/spmi-0/spmi0-02/c440000.qcom,spmi:qcom,pm8150b@2:qcom,usb-pdphy@1700/usbpd0/usb_limit_source_enable u:object_r:sysfs_limit_power_transfer:s0
genfscon debugfs /logbuffer/ssoc u:object_r:debugfs_batteryinfo:s0
genfscon debugfs /logbuffer/ttf u:object_r:debugfs_batteryinfo:s0
genfscon debugfs /logbuffer/batt_ce u:object_r:debugfs_batteryinfo:s0
diff --git a/vendor/google/hal_usb_gadget_impl.te b/vendor/google/hal_usb_gadget_impl.te
new file mode 100644
index 0000000..4becfce
--- /dev/null
+++ b/vendor/google/hal_usb_gadget_impl.te
@@ -0,0 +1,14 @@
+type hal_usb_gadget_impl, domain;
+hal_server_domain(hal_usb_gadget_impl, hal_usb)
+hal_server_domain(hal_usb_gadget_impl, hal_usb_gadget)
+
+type hal_usb_gadget_impl_exec, vendor_file_type, exec_type, file_type;
+init_daemon_domain(hal_usb_gadget_impl)
+
+allow hal_usb_gadget_impl configfs:dir { create rmdir };
+allow hal_usb_gadget_impl functionfs:dir { watch watch_reads };
+set_prop(hal_usb_gadget_impl, vendor_usb_prop)
+
+allow hal_usb_gadget_impl sysfs_batteryinfo:dir r_dir_perms;
+allow hal_usb_gadget_impl sysfs_batteryinfo:file rw_file_perms;
+allow hal_usb_gadget_impl sysfs_extcon:dir search;
\ No newline at end of file
diff --git a/vendor/google/hal_usb_impl.te b/vendor/google/hal_usb_impl.te
index 7f4d632..bd5f43c 100644
--- a/vendor/google/hal_usb_impl.te
+++ b/vendor/google/hal_usb_impl.te
@@ -10,6 +10,7 @@
allow hal_usb_impl sysfs_batteryinfo:dir search;
allow hal_usb_impl sysfs_batteryinfo:file r_file_perms;
allow hal_usb_impl sysfs_contaminant:file rw_file_perms;
+allow hal_usb_impl sysfs_limit_power_transfer:file rw_file_perms;
set_prop(hal_usb_impl, vendor_usb_prop)
allow hal_usb_impl sysfs_extcon:dir search;
diff --git a/vendor/qcom/common/file.te b/vendor/qcom/common/file.te
index aa14724..4ba1c4a 100644
--- a/vendor/qcom/common/file.te
+++ b/vendor/qcom/common/file.te
@@ -200,6 +200,8 @@
# kgsl file type for sysfs access
type sysfs_kgsl, sysfs_type, fs_type;
type sysfs_kgsl_proc, sysfs_type, fs_type;
+type sysfs_kgsl_shell, sysfs_type, fs_type;
+
# kgsl snapshot file type for sysfs access
type sysfs_kgsl_snapshot, sysfs_type, fs_type;
@@ -338,4 +340,4 @@
type modem_fdr_file, file_type, data_file_type;
# Warm reset
-type sysfs_poweroff, sysfs_type, fs_type;
\ No newline at end of file
+type sysfs_poweroff, sysfs_type, fs_type;
diff --git a/vendor/qcom/common/genfs_contexts b/vendor/qcom/common/genfs_contexts
index 72cdede..29a9078 100644
--- a/vendor/qcom/common/genfs_contexts
+++ b/vendor/qcom/common/genfs_contexts
@@ -4,6 +4,7 @@
genfscon sysfs /kernel/boot_slpi/boot u:object_r:sysfs_msm_boot:s0
genfscon sysfs /class/uio u:object_r:sysfs_uio:s0
genfscon sysfs /devices/virtual/kgsl/kgsl/proc u:object_r:sysfs_kgsl_proc:s0
+genfscon sysfs /devices/platform/soc/2c00000.qcom,kgsl-3d0/kgsl/kgsl-3d0/perfcounter u:object_r:sysfs_kgsl_shell:s0
genfscon sysfs /devices/platform/soc/0.qcom,rmtfs_sharedmem u:object_r:sysfs_rmtfs:s0
genfscon sysfs /devices/platform/soc/soc:qcom,kgsl-hyp u:object_r:sysfs_msm_subsys:s0
genfscon sysfs /devices/platform/soc/soc:qcom,spss_utils u:object_r:sysfs_spss:s0
diff --git a/vendor/qcom/common/shell.te b/vendor/qcom/common/shell.te
new file mode 100644
index 0000000..cd0e4a4
--- /dev/null
+++ b/vendor/qcom/common/shell.te
@@ -0,0 +1,3 @@
+# allow shell users to control kgsl perfcounters
+allow shell sysfs_kgsl_shell:file rw_file_perms;
+allow shell sysfs_msm_subsys:dir r_dir_perms;