summaryrefslogtreecommitdiff
path: root/services/java/com/android/server/SensorService.java
diff options
context:
space:
mode:
authorThe Android Open Source Project <initial-contribution@android.com>2009-03-05 14:34:35 -0800
committerThe Android Open Source Project <initial-contribution@android.com>2009-03-05 14:34:35 -0800
commit4df2423a947bcd3f024cc3d3a1a315a8dc428598 (patch)
treee7dac2c5a367b169e7f05a36058cf470e93f003b /services/java/com/android/server/SensorService.java
parentc474dec3ffa1c0fe37edb3e701684188f7e8e7bc (diff)
auto import from //depot/cupcake/@136594
Diffstat (limited to 'services/java/com/android/server/SensorService.java')
-rw-r--r--services/java/com/android/server/SensorService.java13
1 files changed, 10 insertions, 3 deletions
diff --git a/services/java/com/android/server/SensorService.java b/services/java/com/android/server/SensorService.java
index 29b45ab1beed..b2530383f347 100644
--- a/services/java/com/android/server/SensorService.java
+++ b/services/java/com/android/server/SensorService.java
@@ -45,7 +45,7 @@ class SensorService extends ISensorService.Stub {
private static final int SENSOR_DISABLE = -1;
/**
- * Battery statistics to be updated when sensors are enabled and diabled.
+ * Battery statistics to be updated when sensors are enabled and disabled.
*/
final IBatteryStats mBatteryStats = BatteryStatsService.getService();
@@ -119,7 +119,10 @@ class SensorService extends ISensorService.Stub {
}
Binder.restoreCallingIdentity(identity);
- if (binder == null) throw new NullPointerException("listener is null in enableSensor");
+ if (binder == null) {
+ Log.w(TAG, "listener is null (sensor=" + name + ", id=" + sensor + ")");
+ return false;
+ }
synchronized(mListeners) {
if (enable!=SENSOR_DISABLE && !_sensors_control_activate(sensor, true)) {
@@ -145,7 +148,11 @@ class SensorService extends ISensorService.Stub {
}
if (l == null) {
- throw new NullPointerException("no Listener object in enableSensor");
+ // by construction, this means we're disabling a listener we
+ // don't know about...
+ Log.w(TAG, "listener with binder " + binder +
+ ", doesn't exist (sensor=" + name + ", id=" + sensor + ")");
+ return false;
}
if (minDelay >= 0) {