[Android] Implement 3-way sensor fallback for Device Orientation.
Implement 3-way fallback using 3 sets of sensors for Device Orientation.
The implementation is behind the experimental features flag.
The 3 options in decreasing order of preference are:
A: GAME_ROTATION_VECTOR (relative)
B: ROTATION_VECTOR (absolute)
C: combination of ACCELEROMETER and MAGNETIC_FIELD (absolute)
Some of the sensors may not be available depending on the device and Android
version, so the 3-way fallback ensures selection of the best possible option.
Option A also makes sure the "absolute" property of Device Orientation events
is set to false. This patch also includes the necessary modifications for
UMA logging.
The reasons behind using GAME_ROTATION_VECTOR as first choice for Device
Orientation include better accuracy in the presence of magnetic field and
consistency with Safari on iOS, see crbug.com/397824 and crbug.com/520546
for more details.
BUG=397824,520546
Review URL: https://codereview.chromium.org/
1060213004
Cr-Commit-Position: refs/heads/master@{#344911}