Loading sensors/1.0/default/convert.cpp +9 −1 Original line number Diff line number Diff line Loading @@ -75,6 +75,10 @@ void convertFromSensorEvent(const sensors_event_t &src, Event *dst) { case SensorType::META_DATA: { dst->u.meta.what = (MetaDataEventType)src.meta_data.what; // Legacy HALs contain the handle reference in the meta data field. // Copy that over to the handle of the event. In legacy HALs this // field was expected to be 0. dst->sensorHandle = src.meta_data.sensor; break; } Loading Loading @@ -212,8 +216,12 @@ void convertToSensorEvent(const Event &src, sensors_event_t *dst) { switch (src.sensorType) { case SensorType::META_DATA: { // Legacy HALs expect the handle reference in the meta data field. // Copy it over from the handle of the event. dst->meta_data.what = (int32_t)src.u.meta.what; dst->meta_data.sensor = dst->sensor; dst->meta_data.sensor = src.sensorHandle; // Set the sensor handle to 0 to maintain compatibility. dst->sensor = 0; break; } Loading sensors/1.0/default/service.cpp +5 −1 Original line number Diff line number Diff line Loading @@ -23,5 +23,9 @@ using android::hardware::sensors::V1_0::ISensors; using android::hardware::defaultPassthroughServiceImplementation; int main() { return defaultPassthroughServiceImplementation<ISensors>(); /* Sensors framework service needs at least two threads. * One thread blocks on a "poll" * The second thread is needed for all other HAL methods. */ return defaultPassthroughServiceImplementation<ISensors>(2); } Loading
sensors/1.0/default/convert.cpp +9 −1 Original line number Diff line number Diff line Loading @@ -75,6 +75,10 @@ void convertFromSensorEvent(const sensors_event_t &src, Event *dst) { case SensorType::META_DATA: { dst->u.meta.what = (MetaDataEventType)src.meta_data.what; // Legacy HALs contain the handle reference in the meta data field. // Copy that over to the handle of the event. In legacy HALs this // field was expected to be 0. dst->sensorHandle = src.meta_data.sensor; break; } Loading Loading @@ -212,8 +216,12 @@ void convertToSensorEvent(const Event &src, sensors_event_t *dst) { switch (src.sensorType) { case SensorType::META_DATA: { // Legacy HALs expect the handle reference in the meta data field. // Copy it over from the handle of the event. dst->meta_data.what = (int32_t)src.u.meta.what; dst->meta_data.sensor = dst->sensor; dst->meta_data.sensor = src.sensorHandle; // Set the sensor handle to 0 to maintain compatibility. dst->sensor = 0; break; } Loading
sensors/1.0/default/service.cpp +5 −1 Original line number Diff line number Diff line Loading @@ -23,5 +23,9 @@ using android::hardware::sensors::V1_0::ISensors; using android::hardware::defaultPassthroughServiceImplementation; int main() { return defaultPassthroughServiceImplementation<ISensors>(); /* Sensors framework service needs at least two threads. * One thread blocks on a "poll" * The second thread is needed for all other HAL methods. */ return defaultPassthroughServiceImplementation<ISensors>(2); }