Package-level declarations
Types
Reads the TYPE_ACCELEROMETER sensor (x/y/z acceleration in m/s2). No permissions. With duration_ms (1-5000) it collects a series of samples; otherwise it captures a single reading. See readSensor for the sampling/timeout mechanics. Output: latest x, y, z, accuracy, timestamp, plus a readings list of {x,y,z,timestamp}. Returns ToolResult.error when the device has no accelerometer.
Reads the TYPE_GYROSCOPE sensor (x/y/z angular rate in rad/s). No permissions. With duration_ms (1-5000) it collects a series of samples; otherwise a single reading. See readSensor. Output: latest x, y, z, accuracy, timestamp, plus a readings list of {x,y,z,timestamp}. Returns ToolResult.error when the device has no gyroscope.
Reads the TYPE_LIGHT ambient-light sensor (illuminance in lux). No permissions. With duration_ms (1-5000) it collects a series of samples; otherwise a single reading. See readSensor. Output: latest lux, accuracy, timestamp, plus a readings list of {lux,timestamp}. Returns ToolResult.error when the device has no light sensor.
Reads the TYPE_PROXIMITY sensor. No permissions. Many devices report only binary near/far rather than a true centimetre distance. With duration_ms (1-5000) it collects a series of samples; otherwise a single reading. See readSensor. Output: latest distance_cm, is_near (distance < 5cm), accuracy, timestamp, plus a readings list of {distance_cm,is_near,timestamp}. Returns ToolResult.error when the device has no proximity sensor.
A single sensor sample captured by readSensor.
Provider for the motion/environment sensor tools (accelerometer, gyroscope, light, proximity). None of these require any permission.
Functions
Registers a one-shot listener on the default sensor of sensorType and collects readings.