CNA-PLAT-014: Compass and Motion work only on Android; desktop sensors come only through the SDL3 platform, and web targets are refused
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.
Compass::IsSupported and Motion::IsSupported are false everywhere except Android because SDL3 exposes no magnetometer or fused-orientation API; Accelerometer and Gyroscope are supported on Android, iOS and desktop but never in a browser.
- Identifier
CNA-PLAT-014- Category
- Platform limitation
- Subsystem
- Platforms
- 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
- Compass, Motion, Accelerometer and Gyroscope IsSupported per target
Expected behaviour
WP7's four sensor classes on every CNA target.
Actual behaviour at TARGET
Compass.cpp returns the Android backend's answer under __ANDROID__ and false otherwise (“SDL3 exposes no magnetometer/compass API on any supported platform”); Motion.cpp has the same shape. Accelerometer.cpp accepts Android, iOS and Desktop targets and excludes the browser “by the established target policy”.
Source locations
modules/devices/src/Sensors/Compass.cpp— Compass::getIsSupportedPropertymodules/devices/src/Sensors/Motion.cpp— Motion::getIsSupportedPropertymodules/devices/src/Sensors/Accelerometer.cpp— Accelerometer::getIsSupportedProperty target policy
Evidence
Checked by reading at 009d40f5; not executed.
Focused reproduction
No focused reproduction is known. Nothing has been invented here; the evidence above is what exists.
Current tests
The not-supported paths are unit tested on the host.
Regression test
None; a new backend would bring its own tests.
Blast radius
Games using Compass or Motion outside Android, or any sensor in a browser build.
Workaround
Check IsSupported and fall back to other input.
Related pages
The same subject is explained at several altitudes. These are the neighbouring pages at each one.
- User guide
- Sensors guide
- Known issues
- Platform limitation index