am 7869e224: CW on L: Fix a SIGSEGV crash in sensor service.

* commit '7869e224aaaf717b5ab86df00b60fd5be5a0996c':
  CW on L: Fix a SIGSEGV crash in sensor service.
This commit is contained in:
Sean Wan 2014-07-15 18:50:12 +00:00 committed by Android Git Automerger
commit fb3e63fcc7
1 changed files with 6 additions and 2 deletions

View File

@ -490,8 +490,12 @@ bool SensorService::isVirtualSensor(int handle) const {
}
bool SensorService::isWakeUpSensorEvent(const sensors_event_t& event) const {
SensorInterface* sensor = mSensorMap.valueFor(event.sensor);
return sensor->getSensor().isWakeUpSensor();
int handle = event.sensor;
if (event.type == SENSOR_TYPE_META_DATA) {
handle = event.meta_data.sensor;
}
SensorInterface* sensor = mSensorMap.valueFor(handle);
return sensor != NULL && sensor->getSensor().isWakeUpSensor();
}
Vector<Sensor> SensorService::getSensorList()