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

Commit 30835e95 authored by Andrei Ciubotariu's avatar Andrei Ciubotariu
Browse files

UsbCommand: Print error and bail when failing to get USB service

Bug: 373078564
Flag: EXEMPT bugfix
Change-Id: Ia9eb80cec5326572b73fd11ec3c2ac7a00424519
parent a54f82cd
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -89,6 +89,11 @@ public class UsbCommand extends Svc.Command {
            IUsbManager usbMgr = IUsbManager.Stub.asInterface(ServiceManager.getService(
                    Context.USB_SERVICE));

            if (usbMgr == null) {
                System.err.println("Could not obtain USB service. Try again later.");
                return;
            }

            Executor executor = context.getMainExecutor();
            Consumer<Integer> consumer = new Consumer<Integer>(){
                public void accept(Integer status){