Comment 4 for bug 1317243

Revision history for this message
Thomas Voß (thomas-voss) wrote :

Right now, we are not using the fusioned orientation sensor provided by the Android HAL and Android SensorService but instead do the thresholding ourselves in:

  * http://bazaar.launchpad.net/~phablet-team/qtubuntu-sensors/trunk/view/head:/plugins/sensors/core_orientation_sensor.cpp

For that, our calculations might well be too sensitive to outliers and we should instead switch to the fusioned orientation sensor available from Android, see:

  * http://androidxref.com/4.4.2_r2/xref/hardware/libhardware/include/hardware/sensors.h#286

Together with some low-pass filtering that would give us continuous device orientation values in ° in the range of [0, 360]. Finally, I think the shell should apply some interpretation and translate the continuous readings into discrete screen orientation values, like:

  * ScreenOrientation::Landscape
  * ScreenOrientation::Portrait
  * ScreenOrientation::ReversedLandscape
  * ScreenOrientation::ReversedPortrait

and provide state changes to applications, too. I think both continuous and discrete information are useful to app authors. HOwever, the interpretation of screen orientation should be carried out in a central place and not necessarily by individual apps or toolkits (for the sake of synchronization).