Sensors: MultiHal: ignore errors from poll calls

MultiHal was not properly fielding errors from the poll() calls of
sub-HALs.  Propagating errors received from sub-HALs up to Sensor
Services causes Sensor Services to abort, so instead of propagating
the error up to Sensor Services, the MultiHal logs a message to
logcat to fix the sub-HAL problem.

Bug: 30060537
Change-Id: I6e20c193a2f2d228da48cf3d5a23e439eaf663df
This commit is contained in:
Nick Vaccaro
2016-07-19 10:34:00 -07:00
parent 890a976bb9
commit 59d9fb4f88

View File

@@ -155,7 +155,11 @@ void *writerTask(void* ptr) {
ALOGV("writerTask before poll() - bufferSize = %d", bufferSize);
eventsPolled = device->poll(device, buffer, bufferSize);
ALOGV("writerTask poll() got %d events.", eventsPolled);
if (eventsPolled == 0) {
if (eventsPolled <= 0) {
if (eventsPolled < 0) {
ALOGV("writerTask ignored error %d from %s", eventsPolled, device->common.module->name);
ALOGE("ERROR: Fix %s so it does not return error from poll()", device->common.module->name);
}
continue;
}
pthread_mutex_lock(&queue_mutex);