From c6a67a3d1cefe2f0426cb1070f68accf9ae38850 Mon Sep 17 00:00:00 2001 From: 03fernanda-palacios <03fernanda.palacios@gmail.com> Date: Thu, 14 Nov 2024 13:54:41 -0800 Subject: [PATCH] usb broadcast when usb attatched fix --- .../src/main/java/net/discdd/bundletransport/UsbFragment.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/BundleTransport/app/src/main/java/net/discdd/bundletransport/UsbFragment.java b/BundleTransport/app/src/main/java/net/discdd/bundletransport/UsbFragment.java index ffbb9e1d0f..12a9d3ec35 100644 --- a/BundleTransport/app/src/main/java/net/discdd/bundletransport/UsbFragment.java +++ b/BundleTransport/app/src/main/java/net/discdd/bundletransport/UsbFragment.java @@ -245,7 +245,9 @@ private void handleUsbBroadcast(Intent intent) { private void checkUsbConnection(int tries) { usbConnected = !usbManager.getDeviceList().isEmpty(); getActivity().getMainExecutor().execute(() -> { - if (usbManager.getDeviceList().isEmpty()) { + if (!usbManager.getDeviceList().isEmpty()) { + updateUsbStatus(true, getString(R.string.usb_connection_detected), Color.GREEN); + } else { updateUsbStatus(false, getString(R.string.no_usb_connection_detected), Color.RED); } });