OSDN Git Service

Fix crash in SensorService. Ignore devices with no sensors.
authorAravind Akella <aakella@google.com>
Wed, 24 Jun 2015 15:31:32 +0000 (08:31 -0700)
committerAravind Akella <aakella@google.com>
Wed, 24 Jun 2015 15:32:56 +0000 (08:32 -0700)
Change-Id: I1491740baa6348f97c336b6883b11ad2ab93cf73

services/sensorservice/SensorService.cpp

index cf750ee..f6ff092 100644 (file)
@@ -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");