Loading core/jni/android_hardware_SensorManager.cpp +2 −3 Original line number Diff line number Diff line Loading @@ -160,7 +160,6 @@ private: ASensorEvent buffer[16]; while ((n = q->read(buffer, 16)) > 0) { for (int i=0 ; i<n ; i++) { if (buffer[i].type == SENSOR_TYPE_STEP_COUNTER) { // step-counter returns a uint64, but the java API only deals with floats float value = float(buffer[i].u64.step_counter); Loading @@ -183,17 +182,17 @@ private: buffer[i].vector.status, buffer[i].timestamp); } if (env->ExceptionCheck()) { mSensorQueue->sendAck(buffer, n); ALOGE("Exception dispatching input event."); return 1; } } mSensorQueue->sendAck(buffer, n); } if (n<0 && n != -EAGAIN) { // FIXME: error receiving events, what to do in this case? } return 1; } }; Loading native/android/sensor.cpp +5 −2 Original line number Diff line number Diff line Loading @@ -123,9 +123,12 @@ int ASensorEventQueue_hasEvents(ASensorEventQueue* queue) ssize_t ASensorEventQueue_getEvents(ASensorEventQueue* queue, ASensorEvent* events, size_t count) { return static_cast<SensorEventQueue*>(queue)->read(events, count); ssize_t actual = static_cast<SensorEventQueue*>(queue)->read(events, count); if (actual > 0) { static_cast<SensorEventQueue*>(queue)->sendAck(events, actual); } return actual; } /*****************************************************************************/ Loading Loading
core/jni/android_hardware_SensorManager.cpp +2 −3 Original line number Diff line number Diff line Loading @@ -160,7 +160,6 @@ private: ASensorEvent buffer[16]; while ((n = q->read(buffer, 16)) > 0) { for (int i=0 ; i<n ; i++) { if (buffer[i].type == SENSOR_TYPE_STEP_COUNTER) { // step-counter returns a uint64, but the java API only deals with floats float value = float(buffer[i].u64.step_counter); Loading @@ -183,17 +182,17 @@ private: buffer[i].vector.status, buffer[i].timestamp); } if (env->ExceptionCheck()) { mSensorQueue->sendAck(buffer, n); ALOGE("Exception dispatching input event."); return 1; } } mSensorQueue->sendAck(buffer, n); } if (n<0 && n != -EAGAIN) { // FIXME: error receiving events, what to do in this case? } return 1; } }; Loading
native/android/sensor.cpp +5 −2 Original line number Diff line number Diff line Loading @@ -123,9 +123,12 @@ int ASensorEventQueue_hasEvents(ASensorEventQueue* queue) ssize_t ASensorEventQueue_getEvents(ASensorEventQueue* queue, ASensorEvent* events, size_t count) { return static_cast<SensorEventQueue*>(queue)->read(events, count); ssize_t actual = static_cast<SensorEventQueue*>(queue)->read(events, count); if (actual > 0) { static_cast<SensorEventQueue*>(queue)->sendAck(events, actual); } return actual; } /*****************************************************************************/ Loading