Browse Source

whyred: Restore sensors init shell script

Change-Id: I87fa922596dbd890141c123514842de4b91009ab
tags/20190731-pie-lineage
GuaiYiHu 6 months ago
parent
commit
150ac6de2b
No account linked to committer's email address
6 changed files with 67 additions and 13 deletions
  1. 6
    0
      config.fs
  2. 1
    0
      device.mk
  3. 8
    0
      rootdir/Android.mk
  4. 44
    0
      rootdir/bin/init.qcom.sensors.sh
  5. 8
    10
      rootdir/etc/init.qcom.rc
  6. 0
    3
      sepolicy/vendor/file_contexts

+ 6
- 0
config.fs View File

@@ -142,6 +142,12 @@ user: AID_GPS
group: AID_GPS
caps: NET_BIND_SERVICE BLOCK_SUSPEND WAKE_ALARM

[vendor/bin/sensors.qti]
mode: 0755
user: AID_SYSTEM
group: AID_SYSTEM
caps: NET_BIND_SERVICE

[firmware/]
mode: 0771
user: AID_SYSTEM

+ 1
- 0
device.mk View File

@@ -351,6 +351,7 @@ PRODUCT_PACKAGES += \
init.qcom.early_boot.sh \
init.qcom.post_boot.sh \
init.qcom.rc \
init.qcom.sensors.sh \
init.qcom.sh \
init.qcom.usb.rc \
init.qcom.usb.sh \

+ 8
- 0
rootdir/Android.mk View File

@@ -44,6 +44,14 @@ LOCAL_MODULE_PATH := $(TARGET_OUT_VENDOR_EXECUTABLES)
include $(BUILD_PREBUILT)

include $(CLEAR_VARS)
LOCAL_MODULE := init.qcom.sensors.sh
LOCAL_MODULE_TAGS := optional eng
LOCAL_MODULE_CLASS := ETC
LOCAL_SRC_FILES := bin/init.qcom.sensors.sh
LOCAL_MODULE_PATH := $(TARGET_OUT_VENDOR_EXECUTABLES)
include $(BUILD_PREBUILT)

include $(CLEAR_VARS)
LOCAL_MODULE := init.qcom.usb.rc
LOCAL_MODULE_TAGS := optional eng
LOCAL_MODULE_CLASS := ETC

+ 44
- 0
rootdir/bin/init.qcom.sensors.sh View File

@@ -0,0 +1,44 @@
#!/vendor/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()
{
chmod -h 664 /persist/sensors/sensors_settings
chown -h -R system.system /persist/sensors
start vendor.sensors.qti

# Only for SLPI
if [ -c /dev/msm_dsps -o -c /dev/sensors ]; then
start vendor.sensors
fi
}

start_sensors

+ 8
- 10
rootdir/etc/init.qcom.rc View File

@@ -395,14 +395,6 @@ on post-fs-data
mkdir /data/fota 0771
chown system system /data/fota

# SSC/SLPI sensors
mkdir /persist/sensors 0775 sensors sensors
write /persist/sensors/sensors_settings 1
chown system root /persist/sensors/sensors_settings
chmod 0664 /persist/sensors/sensors_settings
chown system system /persist/PRSensorData.txt
chmod 0600 /persist/PRSensorData.txt

#Create directory for hostapd
mkdir /data/hostapd 0770 system wifi

@@ -572,8 +564,9 @@ service vendor.dataqti /system/vendor/bin/qti

service vendor.sensors.qti /vendor/bin/sensors.qti
class core
user root
group root
user system
group system
disabled
writepid /dev/cpuset/system-background/tasks

on property:ro.vendor.use_data_netmgrd=false
@@ -625,6 +618,11 @@ service qcom-sh /vendor/bin/init.qcom.sh
group root system radio
oneshot

service vendor-sensor-sh /vendor/bin/init.qcom.sensors.sh
class core
user root
oneshot

service qcom-post-boot /vendor/bin/init.qcom.post_boot.sh
class late_start
user root

+ 0
- 3
sepolicy/vendor/file_contexts View File

@@ -22,9 +22,6 @@
# Light HAL
/(vendor|system/vendor)/bin/hw/android\.hardware\.light@2\.0-service\.xiaomi_sdm660 u:object_r:hal_light_default_exec:s0

# Persist
/persist/PRSensorData\.txt u:object_r:sensors_persist_file:s0

# Touchscreen
/sys/devices/soc/c175000\.i2c/i2c-1/1-[0-9a-f]+/input/input[0-9]+/wake_gesture u:object_r:sysfs_tap_to_wake:s0


Loading…
Cancel
Save