auto import from //depot/cupcake/@136594
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user