Skip to content

Commit 785fd36

Browse files
pixelflingerAndroid (Google) Code Review
authored andcommitted
Merge "handle EINTR when calling sensor HAL's poll function" into ics-mr1
2 parents 843e04d + 37d95f6 commit 785fd36

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

services/sensorservice/SensorDevice.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,11 @@ status_t SensorDevice::initCheck() const {
166166

167167
ssize_t SensorDevice::poll(sensors_event_t* buffer, size_t count) {
168168
if (!mSensorDevice) return NO_INIT;
169-
return mSensorDevice->poll(mSensorDevice, buffer, count);
169+
ssize_t c;
170+
do {
171+
c = mSensorDevice->poll(mSensorDevice, buffer, count);
172+
} while (c == -EINTR);
173+
return c;
170174
}
171175

172176
status_t SensorDevice::activate(void* ident, int handle, int enabled)

services/sensorservice/SensorService.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,8 @@ bool SensorService::threadLoop()
286286
}
287287
} while (count >= 0 || Thread::exitPending());
288288

289-
LOGW("Exiting SensorService::threadLoop!");
289+
LOGW("Exiting SensorService::threadLoop => aborting...");
290+
abort();
290291
return false;
291292
}
292293

0 commit comments

Comments
 (0)