Package 

Class MotionConfiguration

    • Method Detail

      • getSamplingHz

         final Double getSamplingHz()

        Sensor collection rate (Hz). Accepts the canonical key collectionRateHz, the previous canonical collect, and the legacy hz for parity with iOS; also accepts the existing Android key samplingHz. Tried in priority order by kotlinx.serialization (Json must have useAlternativeNames).

      • getFields

         final Map<String, Boolean> getFields()

        Single per-stream on/off map. Each key matches the wire-format stream name 1:1 — accel, gyroscope, magneticField, rotationVector, gameRotationVector, gravity, proximity, stepCounter, pressure, etc. — so the config map and the JSON data.<stream> object align directly. The map decides whether the underlying Sensor.TYPE_* listener is registered at all — MotionFieldPolicy.want<Sensor> returns true when the stream's key is true (or missing). When false, the listener never starts and the dedicated stream stays silent.

        Each sensor emits its own stream at its own native cadence (with its own sensorTimestamp); there is no fused / interpolated row, so streams are all-or-nothing (no per-axis suppression).

        Omitted / null means "every stream enabled" (backward compatible). Only an explicit false disables a stream. Accepts collectedFields as an alias so older server responses keep working unchanged through the rename.

      • getUseRateReducer

         final Boolean getUseRateReducer()

        Server controls whether decimation is active. Mirrors iOS MotionConfiguration.useRateReducer. Defaults to false so older server builds keep the legacy "no rate reducer" behavior.

      • getRateReducerOutputHz

         final Double getRateReducerOutputHz()

        Target output rate (Hz) for the rate reducer when useRateReducer == true. Null falls back to samplingHz (no reduction).

      • getUseWakeupSensors

         final Boolean getUseWakeupSensors()

        Register the continuous IMU sensors (accel/gyro/mag) as their WAKE-UP variants so the hardware FIFO delivers through AP suspend (AOSP: "No events shall be lost"). Falls back to the non-wake-up sensor automatically when a device has no wake-up variant.

      • getMaxReportLatencyMs

         final Long getMaxReportLatencyMs()

        Hardware FIFO batch window (ms) for the wake-up IMU sensors (maxReportLatencyUs). Larger = fewer AP wakeups/interrupts; realized batch = min(this, FIFO-fill time).

        Default is 0 (unbatched, per-event delivery). Batching delivers events in bursts and stamps wallClockTimestamp at flush time, which surfaces as random multi-second gaps in the wall-clock stream even though sensorTimestamp stays continuous. Unbatched delivery removes that artifact and is effectively free while a continuous wake lock is held (MiscConfiguration.holdWakeLock = true, the default: the AP is already awake).

        COUPLING: in the Play-compliant mode (MiscConfiguration.holdWakeLock = false) a value of 0 forces an AP wakeup per sample. Those fleets should set a non-zero window (Google recommends ≥30s once no continuous wake lock is held) so the FIFO carries continuity through AP suspend.