OSDN Git Service

init: Fix sensors never detected when not available at first boot
authorJaap Jan Meijer <jjmeijer88@gmail.com>
Thu, 28 Jul 2016 16:05:20 +0000 (18:05 +0200)
committerJaap Jan Meijer <jjmeijer88@gmail.com>
Thu, 28 Jul 2016 16:05:20 +0000 (18:05 +0200)
It's possible that no sensors are available at first boot.
By default they will not be checked again, with this patch Android will check every boot.

init.sh

diff --git a/init.sh b/init.sh
index caec377..3bf7051 100644 (file)
--- a/init.sh
+++ b/init.sh
@@ -236,7 +236,7 @@ function init_hal_sensors()
        elif lsmod | grep -q lis3lv02d_i2c; then
                hal_sensors=hdaps
        fi
        elif lsmod | grep -q lis3lv02d_i2c; then
                hal_sensors=hdaps
        fi
-
+       set_property persist.sys.sensors.iio.present 1
        set_property ro.hardware.sensors $hal_sensors
 }
 
        set_property ro.hardware.sensors $hal_sensors
 }