cuttlefish: sepolicy and .rc rules for suspend_blocker

Bug: 136800571
Test: boot cuttlefish, "suspend_blocker" wakelock present
Change-Id: Id7d285900b56cdc5bc374e24969495eb02c7dd77
diff --git a/shared/config/init.product.rc b/shared/config/init.product.rc
index 3e49443..fe7130c 100644
--- a/shared/config/init.product.rc
+++ b/shared/config/init.product.rc
@@ -10,4 +10,10 @@
     class late_start
     group system
     user root
-    disabled
\ No newline at end of file
+    disabled
+
+# TODO: disable this service once cuttlefish implements system suspend
+service suspend_blocker /product/bin/suspend_blocker
+    class main
+    group system
+    user root
diff --git a/shared/device.mk b/shared/device.mk
index f68d2c5..88d8663 100644
--- a/shared/device.mk
+++ b/shared/device.mk
@@ -75,6 +75,7 @@
     tombstone_transmit \
     vsock_logcat \
     tombstone_producer \
+    suspend_blocker \
 
 #
 # Packages for AOSP-available stuff we use from the framework
diff --git a/shared/sepolicy/private/file_contexts b/shared/sepolicy/private/file_contexts
index 0b92144..f0255a0 100644
--- a/shared/sepolicy/private/file_contexts
+++ b/shared/sepolicy/private/file_contexts
@@ -1,4 +1,5 @@
 #############################
 # Product files
 #
+/product/bin/suspend_blocker     u:object_r:suspend_blocker_exec:s0
 /product/bin/tombstone_transmit  u:object_r:tombstone_transmit_exec:s0
diff --git a/shared/sepolicy/private/suspend_blocker.te b/shared/sepolicy/private/suspend_blocker.te
new file mode 100644
index 0000000..41c72b9
--- /dev/null
+++ b/shared/sepolicy/private/suspend_blocker.te
@@ -0,0 +1,6 @@
+type suspend_blocker, domain, coredomain;
+type suspend_blocker_exec, exec_type, file_type;
+
+init_daemon_domain(suspend_blocker);
+
+wakelock_use(suspend_blocker);