summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Aravind Akella <aakella@google.com> 2015-06-24 08:31:32 -0700
committer Aravind Akella <aakella@google.com> 2015-06-24 08:32:56 -0700
commitee155cadb23e84542cbf445c2aac89ae63df4cc7 (patch)
tree9d81b04342a2d3e227ba4b5fdea24173d97d628c
parent8f37aa5011bf5d8c0a67126b92e3b435ffd4dca0 (diff)
Fix crash in SensorService. Ignore devices with no sensors.
Change-Id: I1491740baa6348f97c336b6883b11ad2ab93cf73
-rw-r--r--services/sensorservice/SensorService.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/services/sensorservice/SensorService.cpp b/services/sensorservice/SensorService.cpp
index cf750ee7c5..f6ff092773 100644
--- a/services/sensorservice/SensorService.cpp
+++ b/services/sensorservice/SensorService.cpp
@@ -271,6 +271,8 @@ status_t SensorService::dump(int fd, const Vector<String16>& args)
dev.enableAllSensors();
}
return status_t(NO_ERROR);
+ } else if (mSensorList.size() == 0) {
+ result.append("No Sensors on the device\n");
} else {
// Default dump the sensor list and debugging information.
result.append("Sensor List:\n");