device/generic_sensor contains the platform-specific parts of the Sensor APIs implementation.
Sensors Mojo interfaces are defined in the
The JS bindings are implemented in
Support for the SensorTypes defined by the Mojo interface is summarized in this table. An empty cell indicates that the sensor type is not supported on that platform.
Sensors are implemented by passing through values provided by the Sensor class. The values in the “Android” column of the table above correspond to the integer constants from the android.hardware.Sensor used to provide data for a SensorType.
Sensors are implemented by reading values from the IIO subsystem. The values in the “Linux” column of the table above are the prefix of the sysfs files Chrome searches for to provide data for a SensorType.
On this platform there is limited support for sensors. The AMBIENT_LIGHT sensor type is provided by interpreting the value that can be read from the LMU. The ACCELEROMETER sensor type is provided by interpreting the value that can be read from the SMCMotionSensor.
Sensors are implemented by passing through values provided by the Sensor API. The values in the “Windows” column of the table above correspond to the names of the sensor type GUIDs used to provide data for a SensorType.
Sensors platform unit tests are located in the current directory and its subdirectories.
The sensors unit tests file for Android is
Sensors browser tests are located in
Please refer to the design documentation for more details.