OSDN Git Service

init.sh: allow HAS_SENSORS to override all cases
authorChih-Wei Huang <cwhuang@linux.org.tw>
Mon, 4 Jun 2018 15:22:27 +0000 (23:22 +0800)
committerChih-Wei Huang <cwhuang@linux.org.tw>
Mon, 4 Jun 2018 15:22:27 +0000 (23:22 +0800)
HAS_SENSORS in cmdline was introduced in commit f356d114 to override
the default has_sensors variable. However, it only take effects if
the sensors type is not kbd. This is not my original idea.

The change allows HAS_SENSORS to override the default value no matter
what the sensors type is.

init.sh

diff --git a/init.sh b/init.sh
index ccd1058..2228775 100644 (file)
--- a/init.sh
+++ b/init.sh
@@ -284,11 +284,11 @@ function init_hal_sensors()
                hal_sensors=hdaps
                has_sensors=true
        elif [ "$hal_sensors" != "kbd" ]; then
-               has_sensors=${HAS_SENSORS:-true}
+               has_sensors=true
        fi
 
        set_property ro.hardware.sensors $hal_sensors
-       set_property config.override_forced_orient $has_sensors
+       set_property config.override_forced_orient ${HAS_SENSORS:-$has_sensors}
 }
 
 function create_pointercal()