device/generic/common
Revisión | 239ae98e3d38d3c39c2904abb7c0b662d03fcfd7 (tree) |
---|---|
Tiempo | 2016-10-19 01:37:31 |
Autor | Chih-Wei Huang <cwhuang@linu...> |
Commiter | Chih-Wei Huang |
Force orientation if no sensors
If no known sensors are detected, force the device to remain in its
default orientation. Activities that desire to run in a non-compatible
orientation will be run from an emulated display within the physical
display.
@@ -169,6 +169,7 @@ function init_hal_sensors() | ||
169 | 169 | [ -f /system/lib/hw/sensors.${ro_hardware}.so ] && return 0 |
170 | 170 | |
171 | 171 | local hal_sensors=kbd |
172 | + local has_sensors=true | |
172 | 173 | case "$(cat $DMIPATH/uevent)" in |
173 | 174 | *Lucid-MWE*) |
174 | 175 | set_property ro.ignore_atkbd 1 |
@@ -236,6 +237,7 @@ function init_hal_sensors() | ||
236 | 237 | set_property hal.sensors.iio.accel.matrix 0,1,0,1,0,0,0,0,-1 |
237 | 238 | ;; |
238 | 239 | *) |
240 | + has_sensors=false | |
239 | 241 | ;; |
240 | 242 | esac |
241 | 243 |
@@ -248,6 +250,8 @@ function init_hal_sensors() | ||
248 | 250 | fi |
249 | 251 | |
250 | 252 | set_property ro.hardware.sensors $hal_sensors |
253 | + [ "$hal_sensors" != "kbd" ] && has_sensors=true | |
254 | + set_property config.override_forced_orient $has_sensors | |
251 | 255 | } |
252 | 256 | |
253 | 257 | function create_pointercal() |
@@ -82,4 +82,9 @@ | ||
82 | 82 | <!-- When true use the linux /dev/input/event subsystem to detect the switch changes |
83 | 83 | on the headphone/microphone jack. When false use the older uevent framework. --> |
84 | 84 | <bool name="config_useDevInputEventForAudioJack">true</bool> |
85 | + | |
86 | + <!-- Flag indicating that this device does not rotate and will always remain in its default | |
87 | + orientation. Activities that desire to run in a non-compatible orientation will be run | |
88 | + from an emulated display within the physical display. --> | |
89 | + <bool name="config_forceDefaultOrientation">true</bool> | |
85 | 90 | </resources> |