Package 

Object MotionFieldPolicy


  • 
    public class MotionFieldPolicy
    
                        

    Server-driven selection of which motion sensors are read.

    The single source of truth is MotionConfiguration.fields — a flat map of <stream name> → Boolean. Each key matches the wire-format stream name exactly, so the config map and the JSON data.<stream> object align 1:1:

    accel, accelUncalibrated, linearAccel, gyroscope, gyroscopeUncalibrated, magneticField, magneticFieldUncalibrated, rotationVector, gameRotationVector, geomagneticRotationVector, gravity, proximity, stepCounter, stepDetector, significantMotion, ambientTemperature, light, pressure, relativeHumidity

    Each Sensor.TYPE_* listener is registered when its key is true, and the corresponding per-sensor stream emits whenever the listener is active. Each sensor reports independently with its own sensorTimestamp; there is no fused row.

    Semantics:

    • null map ⇒ every stream treated as enabled (backward compatible).

    • missing key ⇒ that stream is treated as enabled.

    • explicit false ⇒ stream disabled (listener never registered, payload array always empty).