Fix crash in SensorService. Ignore devices with no sensors.

Change-Id: I1491740baa6348f97c336b6883b11ad2ab93cf73
This commit is contained in:
Aravind Akella 2015-06-24 08:31:32 -07:00
parent 8f37aa5011
commit ee155cadb2

View File

@ -271,6 +271,8 @@ status_t SensorService::dump(int fd, const Vector<String16>& args)
dev.enableAllSensors(); dev.enableAllSensors();
} }
return status_t(NO_ERROR); return status_t(NO_ERROR);
} else if (mSensorList.size() == 0) {
result.append("No Sensors on the device\n");
} else { } else {
// Default dump the sensor list and debugging information. // Default dump the sensor list and debugging information.
result.append("Sensor List:\n"); result.append("Sensor List:\n");