• R/O
  • HTTP
  • SSH
  • HTTPS

コミット

タグ
未設定

よく使われているワード(クリックで追加)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

device/generic/common


コミットメタ情報

リビジョンf356d114daed148133e80daa0783ad0ff20db2d2 (tree)
日時2018-01-12 18:41:15
作者Chih-Wei Huang <cwhuang@linu...>
コミッターChih-Wei Huang

ログメッセージ

init.sh: refine the rule of has_sensors

Allow to set has_sensors variable via cmdline HAS_SENSORS=true/false.

For sensors of iio type, if there is no acceleration sensors, treat it
as no sensors.

変更サマリ

差分

--- a/init.sh
+++ b/init.sh
@@ -273,13 +273,16 @@ function init_hal_sensors()
273273 # has iio sensor-hub?
274274 if [ -n "`ls /sys/bus/iio/devices/iio:device* 2> /dev/null`" ]; then
275275 busybox chown -R 1000.1000 /sys/bus/iio/devices/iio:device*/
276+ [ -n "`ls /sys/bus/iio/devices/iio:device*/in_accel_x_raw 2> /dev/null`" ] && has_sensors=true
276277 hal_sensors=iio
277278 elif lsmod | grep -q lis3lv02d_i2c; then
278279 hal_sensors=hdaps
280+ has_sensors=true
281+ elif [ "$hal_sensors" != "kbd" ]; then
282+ has_sensors=${HAS_SENSORS:-true}
279283 fi
280284
281285 set_property ro.hardware.sensors $hal_sensors
282- [ "$hal_sensors" != "kbd" ] && has_sensors=true
283286 set_property config.override_forced_orient $has_sensors
284287 }
285288