From 5354f31770ce020f97befa91f78b43faa83aca1c Mon Sep 17 00:00:00 2001 From: Vishal Bhoj Date: Thu, 17 May 2012 05:49:52 +0000 Subject: common: Add disablesuspend script It is derived from liuyq's version but can run locally on the device. It needs to be run once boot to homescreen. Change-Id: Ie769def79b66fd800d1b65fe891a5ff740230e6c Signed-off-by: Vishal Bhoj --- common.mk | 1 + disablesuspend.sh | 26 ++++++++++++++++++++++++++ 2 files changed, 27 insertions(+) create mode 100755 disablesuspend.sh diff --git a/common.mk b/common.mk index dc60160..2027e5e 100644 --- a/common.mk +++ b/common.mk @@ -61,6 +61,7 @@ V8BENCHMARKS := $(foreach js,$(wildcard $(TOP)/external/v8/benchmarks/*.js),\ PRODUCT_COPY_FILES := \ device/linaro/common/wallpaper_info.xml:data/system/wallpaper_info.xml \ + device/linaro/common/disablesuspend.sh:system/bin/disablesuspend.sh \ $(V8BENCHMARKS) $(call inherit-product, $(SRC_TARGET_DIR)/product/core.mk) diff --git a/disablesuspend.sh b/disablesuspend.sh new file mode 100755 index 0000000..35ccfad --- /dev/null +++ b/disablesuspend.sh @@ -0,0 +1,26 @@ +#!/system/bin/sh +# Copyright (C) 2012 Linaro Limited + +# Author: Linaro Validation Team +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + + stay_awake="delete from system where name='stay_on_while_plugged_in'; insert into system (name, value) values ('stay_on_while_plugged_in','3');" + screen_sleep="delete from system where name='screen_off_timeout'; insert into system (name, value) values ('screen_off_timeout','-1');" + lockscreen="delete from secure where name='lockscreen.disabled'; insert into secure (name, value) values ('lockscreen.disabled','1');" + sqlite3 /data/data/com.android.providers.settings/databases/settings.db "${stay_awake}" ## set stay awake + sqlite3 /data/data/com.android.providers.settings/databases/settings.db "${screen_sleep}" # set sleep to none + sqlite3 /data/data/com.android.providers.settings/databases/settings.db "${lockscreen}" ##set lock screen to none + input keyevent 82 ##unlock the home screen + service call power 1 i32 26 ##acquireWakeLock FULL_WAKE_LOCK -- cgit v1.2.3