Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7869e224 authored by Sean Wan's avatar Sean Wan
Browse files

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

This is to fix b/16189080.

BUG: 16189080
Change-Id: I78d44e82f797c0808891acde609040c46745a0bb
parent 2a0e4094
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -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()