Merge "common: init: move sensor service to it's own script"

This commit is contained in:
Linux Build Service Account 2015-07-11 15:14:19 -07:00 committed by Gerrit - the friendly Code Review server
commit 1b824b2250
5 changed files with 60 additions and 17 deletions

View File

@ -257,6 +257,7 @@ INIT += init.qcom.uicc.sh
INIT += fstab.qcom
INIT += init.qcom.debug.sh
INIT += init.qcom.zram.sh
INIT += init.qcom.sensors.sh
#IPROUTE2
IPROUTE2 := ip

View File

@ -210,3 +210,11 @@ LOCAL_MODULE_TAGS := optional eng
LOCAL_MODULE_CLASS := ETC
LOCAL_SRC_FILES := etc/init.qcom.uicc.sh
include $(BUILD_PREBUILT)
include $(CLEAR_VARS)
LOCAL_MODULE := init.qcom.sensors.sh
LOCAL_MODULE_TAGS := optional eng
LOCAL_MODULE_CLASS := ETC
LOCAL_SRC_FILES := etc/init.qcom.sensors.sh
LOCAL_MODULE_PATH := $(TARGET_ROOT_OUT)
include $(BUILD_PREBUILT)

View File

@ -704,6 +704,11 @@ service qcom-sh /system/bin/sh /init.qcom.sh
user root
oneshot
service sensor-sh /system/bin/sh /init.qcom.sensors.sh
class core
user root
oneshot
service qcom-post-boot /system/bin/sh /system/etc/init.qcom.post_boot.sh
class late_start
user root

View File

@ -0,0 +1,46 @@
#!/system/bin/sh
# Copyright (c) 2015, The Linux Foundation. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# * Neither the name of The Linux Foundation nor
# the names of its contributors may be used to endorse or promote
# products derived from this software without specific prior written
# permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
# NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
#
# Function to start sensors for SSC enabled platforms
#
start_sensors()
{
if [ -c /dev/msm_dsps -o -c /dev/sensors ]; then
chmod -h 775 /persist/sensors
chmod -h 664 /persist/sensors/sensors_settings
chown -h system.root /persist/sensors/sensors_settings
mkdir -p /data/misc/sensors
chmod -h 775 /data/misc/sensors
start sensors
fi
}
start_sensors

View File

@ -32,22 +32,6 @@ if [ -f /sys/devices/soc0/soc_id ]; then
else
platformid=`cat /sys/devices/system/soc/soc0/id`
fi
#
# Function to start sensors for DSPS enabled platforms
#
start_sensors()
{
if [ -c /dev/msm_dsps -o -c /dev/sensors ]; then
chmod -h 775 /persist/sensors
chmod -h 664 /persist/sensors/sensors_settings
chown -h system.root /persist/sensors/sensors_settings
mkdir -p /data/misc/sensors
chmod -h 775 /data/misc/sensors
start sensors
fi
}
start_battery_monitor()
{
@ -128,7 +112,6 @@ case "$baseband" in
;;
esac
start_sensors
start_copying_prebuilt_qcril_db
case "$target" in