Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 980cd34d authored by Tom Cherry's avatar Tom Cherry Committed by Android (Google) Code Review
Browse files

Merge "Fix NPE with UsbManager" into main

parents 88fde31b 4686d3ef
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -765,7 +765,11 @@ public class Utils {
            return false;
        }

        final List<UsbPort> usbPortList = context.getSystemService(UsbManager.class).getPorts();
        final UsbManager usbManager = context.getSystemService(UsbManager.class);
        if (usbManager == null) {
            return false;
        }
        final List<UsbPort> usbPortList = usbManager.getPorts();
        if (usbPortList == null || usbPortList.isEmpty()) {
            return false;
        }