aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--device.mk6
-rw-r--r--prevent_suspend.rc8
-rw-r--r--prevent_suspend.sh4
3 files changed, 18 insertions, 0 deletions
diff --git a/device.mk b/device.mk
index d863c45..f81b1d6 100644
--- a/device.mk
+++ b/device.mk
@@ -137,3 +137,9 @@ PRODUCT_PACKAGES += gatekeeper.default
# Enable flashing through heimdall
PRODUCT_COPY_FILES += device/samsung/i9305/resize2fs_partitions.sh:system/bin/resize2fs_partitions.sh
+
+# HACK: prevent the device to go in suspend because it's annoying during early
+# development. Remove afterward as it consume way more energy this way.
+PRODUCT_COPY_FILES += device/samsung/i9305/prevent_suspend.sh:system/bin/prevent_suspend.sh
+PRODUCT_COPY_FILES += device/samsung/i9305/prevent_suspend.rc:system/etc/init/prevent_suspend.rc
+
diff --git a/prevent_suspend.rc b/prevent_suspend.rc
new file mode 100644
index 0000000..8f098ee
--- /dev/null
+++ b/prevent_suspend.rc
@@ -0,0 +1,8 @@
+service prevent_suspend /system/bin/prevent_suspend.sh
+ class main
+ oneshot
+ disabled
+
+on post-fs-data
+ start prevent_suspend
+
diff --git a/prevent_suspend.sh b/prevent_suspend.sh
new file mode 100644
index 0000000..dbea742
--- /dev/null
+++ b/prevent_suspend.sh
@@ -0,0 +1,4 @@
+#!/system/bin/sh
+mkdir -p /storage/sys/power/
+touch /storage/sys/power/state
+mount -o bind /storage/sys/power/state /sys/power/state