aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDenis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>2019-06-12 21:28:58 +0200
committerDenis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>2019-07-01 17:01:28 +0200
commitaf0005f0d674fc08e7b5c0aa86b62d374b5d7878 (patch)
treedd4b42d8b84b0f0a35515e5a8b724dc49d9d23bc
parent15d3b53fcfcf9ea9cbfbffd5432823a9e88ea84b (diff)
downloaddevice_samsung_i9300-af0005f0d674fc08e7b5c0aa86b62d374b5d7878.tar.gz
device_samsung_i9300-af0005f0d674fc08e7b5c0aa86b62d374b5d7878.tar.bz2
device_samsung_i9300-af0005f0d674fc08e7b5c0aa86b62d374b5d7878.zip
HACK: Prevent the device to go in suspend
This is because it's anoying to have the device power off when we're using it though adb. This is for early developement only as it is configurable in the settings->developer menu and it's default value is here: framework/base/packages/SettingsProvider/res/values/defaults.xml It is not desirable to keep that hack in the long run as it makes the device consume power power, which results in a shorter battery life in hours. Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
-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