summaryrefslogtreecommitdiffstats
path: root/core/java/android/hardware
diff options
context:
space:
mode:
authorNick Kralevich <nnk@google.com>2012-10-24 16:29:06 -0700
committerGerrit Code Review <noreply-gerritcodereview@google.com>2012-10-24 16:29:06 -0700
commit7e007ff83738a83f43cb59ddc023a2b860367074 (patch)
treee047a3cdc4e9ca40b22580adcbf75c0599392e5d /core/java/android/hardware
parent86e0d95de1007d339af467c1484b09878ee528fc (diff)
parent6d7a4737643afe05034a36e6ebcd5da1085fbbdc (diff)
downloadframeworks_base-7e007ff83738a83f43cb59ddc023a2b860367074.zip
frameworks_base-7e007ff83738a83f43cb59ddc023a2b860367074.tar.gz
frameworks_base-7e007ff83738a83f43cb59ddc023a2b860367074.tar.bz2
Merge "Sensors could be disabled by any application"
Diffstat (limited to 'core/java/android/hardware')
-rw-r--r--core/java/android/hardware/SystemSensorManager.java3
1 files changed, 2 insertions, 1 deletions
diff --git a/core/java/android/hardware/SystemSensorManager.java b/core/java/android/hardware/SystemSensorManager.java
index 0204e94..7375e7d 100644
--- a/core/java/android/hardware/SystemSensorManager.java
+++ b/core/java/android/hardware/SystemSensorManager.java
@@ -373,7 +373,8 @@ public class SystemSensorManager extends SensorManager {
for (Sensor s : l.getSensors()) {
disableSensorLocked(s);
}
- } else if (l.removeSensor(sensor) == 0) {
+ // Check if the ListenerDelegate has the sensor it is trying to unregister.
+ } else if (l.hasSensor(sensor) && l.removeSensor(sensor) == 0) {
// if we have no more sensors enabled on this listener,
// take it off the list.
sListeners.remove(i);