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

Unverified Commit b6d21a79 authored by Danny Lin's avatar Danny Lin
Browse files

fastboot: Check interface claim status as part of isConnected

Setting the device to null breaks in-progress flashing operations.
parent 30c2cfb8
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -53,7 +53,11 @@ export class FastbootDevice {
     * Returns whether the USB device is currently connected.
     */
    get isConnected() {
        return this.device !== null;
        return (
            this.device !== null &&
            this.device.opened &&
            this.device.configurations[0].interfaces[0].claimed
        );
    }

    /**
@@ -113,7 +117,6 @@ export class FastbootDevice {
                rejected = true;
            }

            this.device = null;
            if (rethrowErrors && rejected) {
                throw error;
            }