-
public class MotionFieldPolicyServer-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 JSONdata.<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 ownsensorTimestamp; there is no fused row.Semantics:
nullmap ⇒ 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).
-
-
Field Summary
Fields Modifier and Type Field Description public final static MotionFieldPolicyINSTANCE
-
Method Summary
-
-
Method Detail
-
isFieldEnabled
final Boolean isFieldEnabled(MotionConfiguration config, String fieldName)
-
hasAnyEnabledField
final Boolean hasAnyEnabledField(MotionConfiguration config)
False only when the server sent an explicit map and every value is false.
-
wantAccelerometer
final Boolean wantAccelerometer(MotionConfiguration config)
-
wantAccelerometerUncalibrated
final Boolean wantAccelerometerUncalibrated(MotionConfiguration config)
-
wantLinearAcceleration
final Boolean wantLinearAcceleration(MotionConfiguration config)
-
wantGyroscope
final Boolean wantGyroscope(MotionConfiguration config)
-
wantGyroscopeUncalibrated
final Boolean wantGyroscopeUncalibrated(MotionConfiguration config)
-
wantMagneticField
final Boolean wantMagneticField(MotionConfiguration config)
-
wantMagneticFieldUncalibrated
final Boolean wantMagneticFieldUncalibrated(MotionConfiguration config)
-
wantRotationVector
final Boolean wantRotationVector(MotionConfiguration config)
-
wantGameRotationVector
final Boolean wantGameRotationVector(MotionConfiguration config)
-
wantGeomagneticRotationVector
final Boolean wantGeomagneticRotationVector(MotionConfiguration config)
-
wantGravity
final Boolean wantGravity(MotionConfiguration config)
-
wantProximity
final Boolean wantProximity(MotionConfiguration config)
-
wantStepCounter
final Boolean wantStepCounter(MotionConfiguration config)
-
wantStepDetector
final Boolean wantStepDetector(MotionConfiguration config)
-
wantSignificantMotion
final Boolean wantSignificantMotion(MotionConfiguration config)
-
wantAmbientTemperature
final Boolean wantAmbientTemperature(MotionConfiguration config)
-
wantLight
final Boolean wantLight(MotionConfiguration config)
-
wantPressure
final Boolean wantPressure(MotionConfiguration config)
-
wantRelativeHumidity
final Boolean wantRelativeHumidity(MotionConfiguration config)
-
-
-
-