Fix for AOSP fusion sensors not handling multiple clients correctly.
Bug: 10786801 Change-Id: I7b938bc583a303a30237c3d93b5accbf64cc90b5
This commit is contained in:
parent
a2ba428a22
commit
bf72deea2f
@ -57,13 +57,13 @@ bool CorrectedGyroSensor::process(sensors_event_t* outEvent,
|
||||
}
|
||||
|
||||
status_t CorrectedGyroSensor::activate(void* ident, bool enabled) {
|
||||
mSensorDevice.activate(this, mGyro.getHandle(), enabled);
|
||||
return mSensorFusion.activate(this, enabled);
|
||||
mSensorDevice.activate(ident, mGyro.getHandle(), enabled);
|
||||
return mSensorFusion.activate(ident, enabled);
|
||||
}
|
||||
|
||||
status_t CorrectedGyroSensor::setDelay(void* ident, int handle, int64_t ns) {
|
||||
mSensorDevice.setDelay(this, mGyro.getHandle(), ns);
|
||||
return mSensorFusion.setDelay(this, ns);
|
||||
mSensorDevice.setDelay(ident, mGyro.getHandle(), ns);
|
||||
return mSensorFusion.setDelay(ident, ns);
|
||||
}
|
||||
|
||||
Sensor CorrectedGyroSensor::getSensor() const {
|
||||
|
@ -67,11 +67,11 @@ bool GravitySensor::process(sensors_event_t* outEvent,
|
||||
}
|
||||
|
||||
status_t GravitySensor::activate(void* ident, bool enabled) {
|
||||
return mSensorFusion.activate(this, enabled);
|
||||
return mSensorFusion.activate(ident, enabled);
|
||||
}
|
||||
|
||||
status_t GravitySensor::setDelay(void* ident, int handle, int64_t ns) {
|
||||
return mSensorFusion.setDelay(this, ns);
|
||||
return mSensorFusion.setDelay(ident, ns);
|
||||
}
|
||||
|
||||
Sensor GravitySensor::getSensor() const {
|
||||
|
@ -51,11 +51,11 @@ bool LinearAccelerationSensor::process(sensors_event_t* outEvent,
|
||||
}
|
||||
|
||||
status_t LinearAccelerationSensor::activate(void* ident, bool enabled) {
|
||||
return mGravitySensor.activate(this, enabled);
|
||||
return mGravitySensor.activate(ident, enabled);
|
||||
}
|
||||
|
||||
status_t LinearAccelerationSensor::setDelay(void* ident, int handle, int64_t ns) {
|
||||
return mGravitySensor.setDelay(this, handle, ns);
|
||||
return mGravitySensor.setDelay(ident, handle, ns);
|
||||
}
|
||||
|
||||
Sensor LinearAccelerationSensor::getSensor() const {
|
||||
|
@ -66,11 +66,11 @@ bool OrientationSensor::process(sensors_event_t* outEvent,
|
||||
}
|
||||
|
||||
status_t OrientationSensor::activate(void* ident, bool enabled) {
|
||||
return mSensorFusion.activate(this, enabled);
|
||||
return mSensorFusion.activate(ident, enabled);
|
||||
}
|
||||
|
||||
status_t OrientationSensor::setDelay(void* ident, int handle, int64_t ns) {
|
||||
return mSensorFusion.setDelay(this, ns);
|
||||
return mSensorFusion.setDelay(ident, ns);
|
||||
}
|
||||
|
||||
Sensor OrientationSensor::getSensor() const {
|
||||
|
@ -53,11 +53,11 @@ bool RotationVectorSensor::process(sensors_event_t* outEvent,
|
||||
}
|
||||
|
||||
status_t RotationVectorSensor::activate(void* ident, bool enabled) {
|
||||
return mSensorFusion.activate(this, enabled);
|
||||
return mSensorFusion.activate(ident, enabled);
|
||||
}
|
||||
|
||||
status_t RotationVectorSensor::setDelay(void* ident, int handle, int64_t ns) {
|
||||
return mSensorFusion.setDelay(this, ns);
|
||||
return mSensorFusion.setDelay(ident, ns);
|
||||
}
|
||||
|
||||
Sensor RotationVectorSensor::getSensor() const {
|
||||
@ -102,11 +102,11 @@ bool GyroDriftSensor::process(sensors_event_t* outEvent,
|
||||
}
|
||||
|
||||
status_t GyroDriftSensor::activate(void* ident, bool enabled) {
|
||||
return mSensorFusion.activate(this, enabled);
|
||||
return mSensorFusion.activate(ident, enabled);
|
||||
}
|
||||
|
||||
status_t GyroDriftSensor::setDelay(void* ident, int handle, int64_t ns) {
|
||||
return mSensorFusion.setDelay(this, ns);
|
||||
return mSensorFusion.setDelay(ident, ns);
|
||||
}
|
||||
|
||||
Sensor GyroDriftSensor::getSensor() const {
|
||||
|
@ -103,7 +103,7 @@ status_t SensorFusion::activate(void* ident, bool enabled) {
|
||||
}
|
||||
|
||||
if (enabled) {
|
||||
ALOGD("SensorFusion calling batch ident=%p ", ident);
|
||||
ALOGD_IF(DEBUG_CONNECTIONS, "SensorFusion calling batch ident=%p ", ident);
|
||||
// Activating a sensor in continuous mode is equivalent to calling batch with the default
|
||||
// period and timeout equal to ZERO, followed by a call to activate.
|
||||
mSensorDevice.batch(ident, mAcc.getHandle(), 0, DEFAULT_EVENTS_PERIOD, 0);
|
||||
|
Loading…
Reference in New Issue
Block a user