-
@Serializable() public final class MotionConfiguration
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public classMotionConfiguration.Companion
-
Field Summary
Fields Modifier and Type Field Description private final IntegerrateReducerNprivate final Booleanenabledprivate final DoublesamplingHzprivate final Map<String, Boolean>fieldsprivate final BooleanuseRateReducerprivate final DoublerateReducerOutputHz
-
Method Summary
Modifier and Type Method Description final IntegergetRateReducerN()final BooleangetEnabled()final DoublegetSamplingHz()Sensor collection rate (Hz). final Map<String, Boolean>getFields()Single per-stream on/off map. final BooleangetUseRateReducer()Server controls whether decimation is active. final DoublegetRateReducerOutputHz()Target output rate (Hz) for the rate reducer when useRateReducer == true.-
-
Method Detail
-
getRateReducerN
final Integer getRateReducerN()
-
getEnabled
final Boolean getEnabled()
-
getSamplingHz
final Double getSamplingHz()
Sensor collection rate (Hz). Accepts the canonical key
collectionRateHz, the previous canonicalcollect, and the legacyhzfor parity with iOS; also accepts the existing Android keysamplingHz. Tried in priority order by kotlinx.serialization (Json must haveuseAlternativeNames).
-
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 JSONdata.<stream>object align directly. The map decides whether the underlyingSensor.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
falsedisables a stream. AcceptscollectedFieldsas 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 tosamplingHz(no reduction).
-
-
-
-