summaryrefslogtreecommitdiffstats
path: root/services
diff options
context:
space:
mode:
authorMathias Agopian <mathias@google.com>2012-09-18 17:18:54 -0700
committerMathias Agopian <mathias@google.com>2012-09-18 17:19:04 -0700
commita5b8e8bfa9f3416ce61ee08162fb139afde60488 (patch)
tree9b761a212bef671405012a41e776b2392bd1328c /services
parent1d12d8a8e61163b35cf42c51c558a67138014e82 (diff)
downloadframeworks_native-a5b8e8bfa9f3416ce61ee08162fb139afde60488.zip
frameworks_native-a5b8e8bfa9f3416ce61ee08162fb139afde60488.tar.gz
frameworks_native-a5b8e8bfa9f3416ce61ee08162fb139afde60488.tar.bz2
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
Diffstat (limited to 'services')
-rw-r--r--services/sensorservice/SensorService.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/services/sensorservice/SensorService.cpp b/services/sensorservice/SensorService.cpp
index 7ab34c9..c9b0f7c 100644
--- a/services/sensorservice/SensorService.cpp
+++ b/services/sensorservice/SensorService.cpp
@@ -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;
}