* TCSETX/TCGETX ioctls used with struct termiox, others do not.
*/
-#ifdef __linux__
+#if defined(__linux__) && !defined(__ANDROID__)
#include <linux/termios.h>
#include "linux_termios.h"
#ifdef HAVE_LIBUDEV
#include "libudev.h"
#endif
+#ifndef __ANDROID__
#include "linux/serial.h"
+#endif
#include "linux_termios.h"
/* TCGETX/TCSETX is not available everywhere. */
#else
int result;
while (1) {
+#ifdef __ANDROID__
+ int arg = 1;
+ result = ioctl(port->fd, TCSBRK, &arg);
+#else
result = tcdrain(port->fd);
+#endif
if (result < 0) {
if (errno == EINTR) {
DEBUG("tcdrain() was interrupted");