Comment 5 for bug 1601887

Revision history for this message
Chris Coulson (chrisccoulson) wrote :

This probably isn't clear to anyone else looking at this bug, but Oxide rotates the camera image based on the current device rotation and the native camera orientation, which we get from the Android camera service via libhybris, using this API:

https://developer.android.com/reference/android/hardware/Camera.html#getCameraInfo(int, android.hardware.Camera.CameraInfo)

The returned native orientation is described in the documentation as (see https://developer.android.com/reference/android/hardware/Camera.CameraInfo.html#orientation):

"The orientation of the camera image. The value is the angle that the camera image needs to be rotated clockwise so it shows correctly on the display in its natural orientation"

In order to do this, we need to know the rotation of the device, which we calculate using the current device orientation referenced to its native orientation.

In this case, the native orientation is incorrect - QScreen::nativeOrientation returns portrait. It should be landscape for the M10 (and other tablets).

Oxide is doing exactly the same thing as Chrome/Android, except that Chrome uses Android's Display.getRotation() API ( https://developer.android.com/reference/android/view/Display.html#getRotation() )