io/m_io_hid_android.c
/* Layer is expected to be locked on entry */
Layer is expected to be locked on entry
Layer is expected to be locked on entry
static void M_io_hid_handle_rw_error(M_io_handle_t *handle, M_io_layer_t *layer)
{
	M_io_hid_signal_shutdown(handle);
	M_io_hid_close_connection(handle);
	if (!(handle->status & (M_IO_HID_STATUS_READERUP|M_IO_HID_STATUS_WRITERUP))) {
		if (handle->disconnect_timer)
			M_event_timer_remove(handle->disconnect_timer);
		handle->disconnect_timer = NULL;
		if (!handle->in_destroy)
			M_io_layer_softevent_add(layer, M_TRUE, M_EVENT_TYPE_DISCONNECTED, M_IO_ERROR_DISCONNECT);
	}
}
static void M_io_hid_handle_rw_error ( M_io_handle_t * handle , M_io_layer_t * layer ) { M_io_hid_signal_shutdown ( handle ) ; M_io_hid_close_connection ( handle ) ; if ( ! ( handle -> status & ( M_IO_HID_STATUS_READERUP | M_IO_HID_STATUS_WRITERUP ) ) ) { if ( handle -> disconnect_timer ) M_event_timer_remove ( handle -> disconnect_timer ) ; handle -> disconnect_timer = NULL ; if ( ! handle -> in_destroy ) M_io_layer_softevent_add ( layer , M_TRUE , M_EVENT_TYPE_DISCONNECTED , M_IO_ERROR_DISCONNECT ) ; } }
Layer is expected to be locked on entry
Layer is expected to be locked on entry
/* Treat a failure as a disconnect. The return of bulkTransfer is always
	 * -1 so we don't know what the error was from. It could have been an
	 * unexpected disconnect or something else. We're always going to close
	 * the device since it's in an unusable state, so it's being disconnected
	 * regardless if that's the reason for the read error. */ /* We have read and write threads going, if we're in the middle of a write
	 * both read and write bulkTransfer operations will error. */ /* Kill any pending disconnect timer and issue a disconnected signal */