hikey: hikey960: Add memtrack HAL

Bug: 65159580
Test: Manual

Change-Id: I7f2ee70284a0b548fb7ea93e93f5e31a1825f721
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
diff --git a/sepolicy/hal_memtrack.te b/sepolicy/hal_memtrack.te
new file mode 100644
index 0000000..c2da124
--- /dev/null
+++ b/sepolicy/hal_memtrack.te
@@ -0,0 +1,11 @@
+type debugfs_kgsl, debugfs_type, fs_type;
+
+allow domain debugfs_kgsl:dir search;
+
+allow hal_memtrack debugfs_kgsl:dir search;
+allow hal_memtrack debugfs_kgsl:file { open read getattr };
+
+# Memtrack reads proc/<pid>/cmdline to check if process is surfaceflinger.
+# Grant access if that's the case; don't log denials for other processes.
+allow hal_memtrack surfaceflinger:file read;
+dontaudit hal_memtrack { domain -surfaceflinger}:file read;