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:
Mathias Agopian 2012-09-18 17:18:54 -07:00
parent 1d12d8a8e6
commit a5b8e8bfa9

View File

@ -462,6 +462,9 @@ status_t SensorService::enable(const sp<SensorEventConnection>& connection,
if (mActiveConnections.indexOf(connection) < 0) {
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) {
Mutex::Autolock _l(mConnectionLock);
if (mSensorInfo.indexOf(handle) <= 0) {
if (mSensorInfo.indexOf(handle) < 0) {
mSensorInfo.add(handle);
return true;
}