aboutsummaryrefslogtreecommitdiffstats
path: root/sepolicy
diff options
context:
space:
mode:
authorAndreas Blaesius <skate4life@gmx.de>2016-02-23 13:39:04 -0800
committerAndreas Blaesius <skate4life@gmx.de>2016-04-18 12:33:12 -0700
commitbcbffd18cda8b95daa2b37c5d0a3c9ae2d98581b (patch)
tree554b11af2ee75c5bb2c117410e86dc53c313e9b8 /sepolicy
parent491824c82435b9e22aa95da3e8a554956e3d74b6 (diff)
downloaddevice_samsung_espressowifi-bcbffd18cda8b95daa2b37c5d0a3c9ae2d98581b.zip
device_samsung_espressowifi-bcbffd18cda8b95daa2b37c5d0a3c9ae2d98581b.tar.gz
device_samsung_espressowifi-bcbffd18cda8b95daa2b37c5d0a3c9ae2d98581b.tar.bz2
espresso: set espresso and espressowifi variants to portrait mode
PS1: initial setup, hwrotation on init for espresso and espressowifi variants PS2-5: proper Selinux rules for Android 5.1 and newer, move ramdisk to system/bin PS6: also set accelerometer and geomagnetic position via sysfs and update Selinux rules Change-Id: I43c662fe98f460e3380aeaa230b1d139d95bd262
Diffstat (limited to 'sepolicy')
-rw-r--r--sepolicy/file_contexts3
-rw-r--r--sepolicy/property.te3
-rw-r--r--sepolicy/property_contexts2
-rw-r--r--sepolicy/variant_setup.te21
4 files changed, 29 insertions, 0 deletions
diff --git a/sepolicy/file_contexts b/sepolicy/file_contexts
index 2161cde..960bc88 100644
--- a/sepolicy/file_contexts
+++ b/sepolicy/file_contexts
@@ -44,3 +44,6 @@
# Firmwares
/system/vendor/firmware/ducati-m3.bin u:object_r:firmware_ducati:s0
+
+# variant setup
+/system/bin/init\.espresso\.variant\.sh u:object_r:variant_setup_exec:s0
diff --git a/sepolicy/property.te b/sepolicy/property.te
new file mode 100644
index 0000000..a6ba71b
--- /dev/null
+++ b/sepolicy/property.te
@@ -0,0 +1,3 @@
+# hwrotation prop need a own type to be set on init.espreso.variants.sh,
+# else it would conflict with a neverallow rule
+type rotation_prop, property_type;
diff --git a/sepolicy/property_contexts b/sepolicy/property_contexts
new file mode 100644
index 0000000..69ad081
--- /dev/null
+++ b/sepolicy/property_contexts
@@ -0,0 +1,2 @@
+# label hwrotation prop to set it on init.espreso.variants.sh
+sf.hwrotation u:object_r:rotation_prop:s0
diff --git a/sepolicy/variant_setup.te b/sepolicy/variant_setup.te
new file mode 100644
index 0000000..b4072ca
--- /dev/null
+++ b/sepolicy/variant_setup.te
@@ -0,0 +1,21 @@
+# Variant-Setup script (init.espresso.variant.sh)
+type variant_setup, domain;
+type variant_setup_exec, exec_type, file_type;
+
+init_daemon_domain(variant_setup)
+
+# Run init.espresso.variant.sh
+allow variant_setup shell_exec:file rx_file_perms;
+allow variant_setup variant_setup_exec:file rx_file_perms;
+
+# Talk to init over the property socket
+unix_socket_connect(variant_setup, property, init)
+
+# Allow getprop/setprop for init.espresso.variant.sh
+allow variant_setup system_file:file execute_no_trans;
+allow variant_setup rotation_prop:property_service set;
+
+# Set accelerometer and geomagnetic position via sysfs
+allow variant_setup sysfs:file write;
+
+allow variant_setup self:capability dac_override;