Changeset View
Changeset View
Standalone View
Standalone View
src/org/kde/kdeconnect/Device.java
Show First 20 Lines • Show All 632 Lines • ▼ Show 20 Line(s) | 64 | public class Device implements BaseLink.PacketReceiver { | |||
---|---|---|---|---|---|
633 | } | 633 | } | ||
634 | 634 | | |||
635 | public boolean sendPacketBlocking(NetworkPacket np) { | 635 | public boolean sendPacketBlocking(NetworkPacket np) { | ||
636 | return sendPacketBlocking(np, defaultCallback); | 636 | return sendPacketBlocking(np, defaultCallback); | ||
637 | } | 637 | } | ||
638 | 638 | | |||
639 | //Async | 639 | //Async | ||
640 | public void sendPacket(final NetworkPacket np, final SendPacketStatusCallback callback) { | 640 | public void sendPacket(final NetworkPacket np, final SendPacketStatusCallback callback) { | ||
641 | new Thread(new Runnable() { | 641 | new Thread(() -> sendPacketBlocking(np, callback)).start(); | ||
642 | @Override | | |||
643 | public void run() { | | |||
644 | sendPacketBlocking(np, callback); | | |||
645 | } | | |||
646 | }).start(); | | |||
647 | } | 642 | } | ||
648 | 643 | | |||
649 | public boolean sendPacketBlocking(final NetworkPacket np, final SendPacketStatusCallback callback) { | 644 | public boolean sendPacketBlocking(final NetworkPacket np, final SendPacketStatusCallback callback) { | ||
650 | 645 | | |||
651 | /* | 646 | /* | ||
652 | if (!m_outgoingCapabilities.contains(np.getType()) && !NetworkPacket.protocolPacketTypes.contains(np.getType())) { | 647 | if (!m_outgoingCapabilities.contains(np.getType()) && !NetworkPacket.protocolPacketTypes.contains(np.getType())) { | ||
653 | Log.e("Device/sendPacket", "Plugin tried to send an undeclared package: " + np.getType()); | 648 | Log.e("Device/sendPacket", "Plugin tried to send an undeclared package: " + np.getType()); | ||
654 | Log.w("Device/sendPacket", "Declared outgoing package types: " + Arrays.toString(m_outgoingCapabilities.toArray())); | 649 | Log.w("Device/sendPacket", "Declared outgoing package types: " + Arrays.toString(m_outgoingCapabilities.toArray())); | ||
▲ Show 20 Lines • Show All 263 Lines • Show Last 20 Lines |