• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

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

device/generic/common


Commit MetaInfo

Revisión239ae98e3d38d3c39c2904abb7c0b662d03fcfd7 (tree)
Tiempo2016-10-19 01:37:31
AutorChih-Wei Huang <cwhuang@linu...>
CommiterChih-Wei Huang

Log Message

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.

Cambiar Resumen

Diferencia incremental

--- a/init.sh
+++ b/init.sh
@@ -169,6 +169,7 @@ function init_hal_sensors()
169169 [ -f /system/lib/hw/sensors.${ro_hardware}.so ] && return 0
170170
171171 local hal_sensors=kbd
172+ local has_sensors=true
172173 case "$(cat $DMIPATH/uevent)" in
173174 *Lucid-MWE*)
174175 set_property ro.ignore_atkbd 1
@@ -236,6 +237,7 @@ function init_hal_sensors()
236237 set_property hal.sensors.iio.accel.matrix 0,1,0,1,0,0,0,0,-1
237238 ;;
238239 *)
240+ has_sensors=false
239241 ;;
240242 esac
241243
@@ -248,6 +250,8 @@ function init_hal_sensors()
248250 fi
249251
250252 set_property ro.hardware.sensors $hal_sensors
253+ [ "$hal_sensors" != "kbd" ] && has_sensors=true
254+ set_property config.override_forced_orient $has_sensors
251255 }
252256
253257 function create_pointercal()
--- a/overlay/frameworks/base/core/res/res/values/config.xml
+++ b/overlay/frameworks/base/core/res/res/values/config.xml
@@ -82,4 +82,9 @@
8282 <!-- When true use the linux /dev/input/event subsystem to detect the switch changes
8383 on the headphone/microphone jack. When false use the older uevent framework. -->
8484 <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>
8590 </resources>