зеркало из https://github.com/mozilla/gecko-dev.git
Bug 746728 - Add sensor index fallback for qemu, r=gal a=b2g-only
This commit is contained in:
Родитель
12e114494a
Коммит
cfb6b5aa66
|
@ -94,6 +94,14 @@ public:
|
|||
SensorRunnable(const sensors_event_t& data)
|
||||
{
|
||||
mSensorData.sensor() = HardwareSensorToHalSensor(data.type);
|
||||
if (mSensorData.sensor() == SENSOR_UNKNOWN) {
|
||||
// Emulator is broken and gives us events without types set
|
||||
const sensor_t* sensors = NULL;
|
||||
SensorDevice& device = SensorDevice::getInstance();
|
||||
size_t size = device.getSensorList(&sensors);
|
||||
if (data.sensor < size)
|
||||
mSensorData.sensor() = HardwareSensorToHalSensor(sensors[data.sensor].type);
|
||||
}
|
||||
mSensorData.accuracy() = HardwareStatusToHalAccuracy(SensorseventStatus(data));
|
||||
mSensorData.timestamp() = data.timestamp;
|
||||
if (mSensorData.sensor() == SENSOR_GYROSCOPE) {
|
||||
|
|
Загрузка…
Ссылка в новой задаче