From 725c1b99b76927423414214c6906844fa4cf81ab Mon Sep 17 00:00:00 2001 From: Chih-Wei Huang Date: Sat, 6 Jun 2015 08:39:30 +0800 Subject: [PATCH] init.sh: add support of iio sensors --- device.mk | 9 +++++---- init.sh | 9 ++++----- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/device.mk b/device.mk index 1b80997..f60b5c4 100644 --- a/device.mk +++ b/device.mk @@ -54,11 +54,12 @@ PRODUCT_COPY_FILES += \ frameworks/native/data/etc/android.hardware.ethernet.xml:system/etc/permissions/android.hardware.ethernet.xml \ frameworks/native/data/etc/android.hardware.location.xml:system/etc/permissions/android.hardware.location.xml \ frameworks/native/data/etc/android.hardware.location.gps.xml:system/etc/permissions/android.hardware.location.gps.xml \ - frameworks/native/data/etc/android.hardware.sensor.proximity.xml:system/etc/permissions/android.hardware.sensor.proximity.xml \ - frameworks/native/data/etc/android.hardware.sensor.light.xml:system/etc/permissions/android.hardware.sensor.light.xml \ - frameworks/native/data/etc/android.hardware.sensor.gyroscope.xml:system/etc/permissions/android.hardware.sensor.gyroscope.xml \ - frameworks/native/data/etc/android.hardware.sensor.barometer.xml:system/etc/permissions/android.hardware.sensor.barometer.xml \ frameworks/native/data/etc/android.hardware.sensor.accelerometer.xml:system/etc/permissions/android.hardware.sensor.accelerometer.xml \ + frameworks/native/data/etc/android.hardware.sensor.barometer.xml:system/etc/permissions/android.hardware.sensor.barometer.xml \ + frameworks/native/data/etc/android.hardware.sensor.compass.xml:system/etc/permissions/android.hardware.sensor.compass.xml \ + frameworks/native/data/etc/android.hardware.sensor.gyroscope.xml:system/etc/permissions/android.hardware.sensor.gyroscope.xml \ + frameworks/native/data/etc/android.hardware.sensor.light.xml:system/etc/permissions/android.hardware.sensor.light.xml \ + frameworks/native/data/etc/android.hardware.sensor.proximity.xml:system/etc/permissions/android.hardware.sensor.proximity.xml \ frameworks/native/data/etc/android.hardware.touchscreen.multitouch.distinct.xml:system/etc/permissions/android.hardware.touchscreen.multitouch.distinct.xml \ frameworks/native/data/etc/android.hardware.touchscreen.multitouch.jazzhand.xml:system/etc/permissions/android.hardware.touchscreen.multitouch.jazzhand.xml \ frameworks/native/data/etc/android.hardware.usb.accessory.xml:system/etc/permissions/android.hardware.usb.accessory.xml \ diff --git a/init.sh b/init.sh index 906f081..8758717 100644 --- a/init.sh +++ b/init.sh @@ -20,6 +20,7 @@ function init_misc() case "$PRODUCT" in T10*TA) + modprobe ak8975 ;; *) ;; @@ -206,11 +207,9 @@ function init_hal_sensors() # has sensor-hub? for i in /sys/bus/iio/devices/iio:device?; do - if [ -e $i/in_accel_scale ]; then - busybox chown -R 1000.1000 /sys/bus/iio/devices/iio:device?/ - hal_sensors=hsb - break - fi + busybox chown -R 1000.1000 /sys/bus/iio/devices/iio:device?/ + lsmod | grep -q hid_sensor_accel_3d && hal_sensors=hsb || hal_sensors=iio + break done set_property ro.hardware.sensors $hal_sensors -- 2.11.0