CNA-VGAP-036: Android sensor conventions are unverified on hardware, and the default landscape remap is a reflection, not a rotation
Evidence basis: source-verified at the pinned commit; tests exist (not executed for this page). Claims on this page were checked by reading the CNA source at commit 009d40f5; unless a sentence says otherwise, nothing here was built or executed. Nothing on this page was executed unless the Evidence section says so.
No hardware QA record exists for Microsoft::Devices; CNA's own MOT2-001 analysis found the default-on landscape remap negates one axis (determinant -1), and the Android compass/motion sign conventions and demo copy are unverified or stale.
- Identifier
CNA-VGAP-036- Category
- Verification gap
- Subsystem
- Testing & evidence
- Status
- Open
- Verified against
- CNA
009d40f5(009d40f5dd085c4e674d3479675fac84b12b3e0a) - Evidence basis
- Source-verified: read at TARGET, not executed
- Tests touching this area
- Yes: see Current tests
- Affected contract
- Accelerometer, Gyroscope, Compass and Motion readings on Android; SetAndroidLandscapeRemapEnabled
Expected behaviour
Sensor axes and signs must match what WP7 games expect on real devices; a coordinate remap for a device rotation should itself be a rotation.
Actual behaviour at TARGET
AndroidSensorOrientation.hpp: ConvertAndroidPortraitToXnaLandscape returns {-x, y, z} or {x, -y, z}, and the remap is enabled by default although the same header concedes real WP7 “never” remaps (a deliberate CNA convenience deviation). AndroidMotionMath.hpp records the MOT2-001 finding that both cases are reflections that no quaternion can represent, left unresolved. devices-hardware-checklist.md states every test runs without sensor hardware; no filled-in copy of the QA template exists. The Android demo's DevicesDemo.cpp/.hpp differ from the desktop demo sources.
Source locations
modules/devices/include/Microsoft/Devices/Sensors/Detail/AndroidSensorOrientation.hpp— ConvertAndroidPortraitToXnaLandscape; default-on remapmodules/devices/include/Microsoft/Devices/Sensors/Detail/AndroidMotionMath.hpp— MOT2-001: the remap is a reflectiondocs/devices-hardware-checklist.md— no hardware in any testmodules/devices/examples/demo_devices/src/DevicesDemo.cpp— desktop demo source that the Android copy no longer matches
Evidence
Checked by reading and diffing the two demo source trees at 009d40f5; not executed; no Android device was used.
Focused reproduction
No focused reproduction is known. Nothing has been invented here; the evidence above is what exists.
Current tests
Host tests (AndroidMotionMathTests.cpp, AndroidCompassMathTests.cpp) check the math, and synthetic-injection tests check dispatch.
Regression test
A recorded hardware run per sensor using docs/devices_sensor_hardware_qa_template.md, and a decision on the remap (a true rotation, or off by default).
Blast radius
Android games using tilt, rotation-rate or compass input; their axes and signs are unverified, and rate vectors transformed by a reflection change handedness.
Workaround
Call SetAndroidLandscapeRemapEnabled(false) and remap in the game, as WP7 games already do.
Related pages
The same subject is explained at several altitudes. These are the neighbouring pages at each one.
- Internals
- Devices internals: Android
- Deep dives
- Sensors and vibration: evidence
- Known issues
- Verification gap index