universal7580: Build vendor.lineage.livedisplay HAL from hardware/samsung
authorJan Altensen <info@stricted.net>
Tue, 29 Jan 2019 11:06:32 +0000 (12:06 +0100)
committerJan Altensen <info@stricted.net>
Fri, 16 Aug 2019 21:18:57 +0000 (23:18 +0200)
Change-Id: I53bce07131a67e677effbdc3e3ae7faed22fe1f6

device-common.mk
sepolicy/file.te
sepolicy/file_contexts
sepolicy/hal_lineage_livedisplay_sysfs.te [new file with mode: 0644]

index 8f984f1319cd055b19cff74f389a578d81931315..2bfbae42414a5d955bb0062652c8e719db243ab2 100644 (file)
@@ -82,6 +82,11 @@ PRODUCT_PACKAGES += \
     android.hardware.light@2.0-impl \
     android.hardware.light@2.0-service
 
+
+# Livedisplay
+PRODUCT_PACKAGES += \
+    vendor.lineage.livedisplay@2.0-service.samsung-exynos
+
 # Media
 PRODUCT_COPY_FILES += \
     $(LOCAL_PATH)/configs/media/media_codecs.xml:$(TARGET_COPY_OUT_VENDOR)/etc/media_codecs.xml \
index e0b86cf1f72f232365a17b3bb86f91652ba3bfa0..7081466a6dde779f68a68461a36f19d6bd2b5332 100644 (file)
@@ -47,3 +47,6 @@ type sysfs_block, sysfs_type, fs_type, mlstrustedobject;
 type sysfs_jack, sysfs_type, fs_type, mlstrustedobject;
 
 allow sysfs_type tmpfs:filesystem associate;
+
+### data types
+type display_vendor_data_file, file_type, data_file_type;
index 64db0792ac0861072d95bc389a0b631322ff6b53..77daec83e5058eff1aa52fa26d495aa675d86180 100644 (file)
@@ -89,8 +89,8 @@
 /data/nfc(/.*)?              u:object_r:nfc_data_file:s0
 /data/\.cid\.info                  u:object_r:wifi_data_file:s0
 /data/misc/conn/\.wifiver\.info    u:object_r:wifi_data_file:s0
-
 /data/misc/radio(/.*)?       u:object_r:radio_data_file:s0
+/data/vendor/display(/.*)?   u:object_r:display_vendor_data_file:s0
 
 # gps
 /data/system/gps(/.*)?       u:object_r:gps_data_file:s0
 /system/bin/gpsd             u:object_r:gpsd_exec:s0
 /system/bin/sswap            u:object_r:sswap_exec:s0
 
+/(vendor|system/vendor)/bin/hw/vendor\.lineage\.livedisplay@2\.0-service\.samsung-exynos    u:object_r:hal_lineage_livedisplay_sysfs_exec:s0
 /(vendor|system/vendor)/bin/hw/vendor\.lineage\.touch@1\.0-service\.samsung                 u:object_r:hal_lineage_touch_default_exec:s0
diff --git a/sepolicy/hal_lineage_livedisplay_sysfs.te b/sepolicy/hal_lineage_livedisplay_sysfs.te
new file mode 100644 (file)
index 0000000..a45c9e1
--- /dev/null
@@ -0,0 +1,12 @@
+# Allow LiveDisplay to store files under /data/vendor/display and access them
+allow hal_lineage_livedisplay_sysfs display_vendor_data_file:dir rw_dir_perms;
+allow hal_lineage_livedisplay_sysfs display_vendor_data_file:file create_file_perms;
+# Allow LiveDisplay to read and write to files in sysfs_graphics, sysfs_mdnie
+allow hal_lineage_livedisplay_sysfs {
+    sysfs_graphics
+    sysfs_mdnie
+}:dir search;
+allow hal_lineage_livedisplay_sysfs {
+    sysfs_graphics
+    sysfs_mdnie
+}:file rw_file_perms;