From af0005f0d674fc08e7b5c0aa86b62d374b5d7878 Mon Sep 17 00:00:00 2001 From: Denis 'GNUtoo' Carikli Date: Wed, 12 Jun 2019 21:28:58 +0200 Subject: 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 --- device.mk | 6 ++++++ prevent_suspend.rc | 8 ++++++++ prevent_suspend.sh | 4 ++++ 3 files changed, 18 insertions(+) create mode 100644 prevent_suspend.rc create mode 100644 prevent_suspend.sh 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 -- cgit v1.2.3