fix a typo in SensorService
It shouldn't have caused much harm though. Also log a warning when enabling a sensor for a connection that is already enabled. Change-Id: Ia4a052381e79183cd4cb1bedc7ba08e5228d7a38
This commit is contained in:
parent
1d12d8a8e6
commit
a5b8e8bfa9
@ -462,6 +462,9 @@ status_t SensorService::enable(const sp<SensorEventConnection>& connection,
|
|||||||
if (mActiveConnections.indexOf(connection) < 0) {
|
if (mActiveConnections.indexOf(connection) < 0) {
|
||||||
mActiveConnections.add(connection);
|
mActiveConnections.add(connection);
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
ALOGW("sensor %08x already enabled in connection %p (ignoring)",
|
||||||
|
handle, connection.get());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -567,7 +570,7 @@ void SensorService::SensorEventConnection::onFirstRef()
|
|||||||
|
|
||||||
bool SensorService::SensorEventConnection::addSensor(int32_t handle) {
|
bool SensorService::SensorEventConnection::addSensor(int32_t handle) {
|
||||||
Mutex::Autolock _l(mConnectionLock);
|
Mutex::Autolock _l(mConnectionLock);
|
||||||
if (mSensorInfo.indexOf(handle) <= 0) {
|
if (mSensorInfo.indexOf(handle) < 0) {
|
||||||
mSensorInfo.add(handle);
|
mSensorInfo.add(handle);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user