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

Unverified Commit 3cc89d56 authored by Danny Lin's avatar Danny Lin
Browse files

dist: Update bundles

parent 7af61e23
Loading
Loading
Loading
Loading
+17 −17
Original line number Diff line number Diff line
@@ -3090,6 +3090,8 @@ class FastbootDevice {
     */
    constructor() {
        this.device = null;
        this.epIn = null;
        this.epOut = null;
        this._registeredUsbListeners = false;
        this._connectResolve = null;
        this._connectReject = null;
@@ -3112,15 +3114,15 @@ class FastbootDevice {
     *
     * @private
     */
    async _validateAndConnectDevice(rethrowErrors) {
    async _validateAndConnectDevice() {
        // Validate device
        let ife = this.device.configurations[0].interfaces[0].alternates[0];
        if (ife.endpoints.length !== 2) {
            throw new UsbError("Interface has wrong number of endpoints");
        }

        let epIn = null;
        let epOut = null;
        this.epIn = null;
        this.epOut = null;
        for (let endpoint of ife.endpoints) {
            logVerbose("Checking endpoint:", endpoint);
            if (endpoint.type !== "bulk") {
@@ -3128,20 +3130,20 @@ class FastbootDevice {
            }

            if (endpoint.direction === "in") {
                if (epIn === null) {
                    epIn = endpoint.endpointNumber;
                if (this.epIn === null) {
                    this.epIn = endpoint.endpointNumber;
                } else {
                    throw new UsbError("Interface has multiple IN endpoints");
                }
            } else if (endpoint.direction === "out") {
                if (epOut === null) {
                    epOut = endpoint.endpointNumber;
                if (this.epOut === null) {
                    this.epOut = endpoint.endpointNumber;
                } else {
                    throw new UsbError("Interface has multiple OUT endpoints");
                }
            }
        }
        logVerbose("Endpoints: in =", epIn, ", out =", epOut);
        logVerbose("Endpoints: in =", this.epIn, ", out =", this.epOut);

        try {
            await this.device.open();
@@ -3162,10 +3164,8 @@ class FastbootDevice {
                this._connectReject = null;
            }

            if (rethrowErrors) {
            throw error;
        }
        }

        // Return from waitForConnect()
        if (this._connectResolve !== null) {
@@ -3266,7 +3266,7 @@ class FastbootDevice {
                // Check whether waitForConnect() is pending and save it for later
                let hasPromiseReject = this._connectReject !== null;
                try {
                    await this._validateAndConnectDevice(false);
                    await this._validateAndConnectDevice();
                } catch (error) {
                    // Only rethrow errors from the event handler if waitForConnect()
                    // didn't already handle them
@@ -3279,7 +3279,7 @@ class FastbootDevice {
            this._registeredUsbListeners = true;
        }

        await this._validateAndConnectDevice(true);
        await this._validateAndConnectDevice();
    }

    /**
@@ -3296,7 +3296,7 @@ class FastbootDevice {
        };
        let respStatus;
        do {
            let respPacket = await this.device.transferIn(0x01, 64);
            let respPacket = await this.device.transferIn(this.epIn, 64);
            let response = new TextDecoder().decode(respPacket.data);

            respStatus = response.substring(0, 4);
@@ -3338,7 +3338,7 @@ class FastbootDevice {

        // Send raw UTF-8 command
        let cmdPacket = new TextEncoder("utf-8").encode(command);
        await this.device.transferOut(0x01, cmdPacket);
        await this.device.transferOut(this.epOut, cmdPacket);
        logDebug("Command:", command);

        return this._readResponse();
@@ -3432,7 +3432,7 @@ class FastbootDevice {
                );
            }

            await this.device.transferOut(0x01, chunk);
            await this.device.transferOut(this.epOut, chunk);

            remainingBytes -= chunk.byteLength;
            i += 1;
@@ -3442,7 +3442,7 @@ class FastbootDevice {
    }

    /**
     * Upload a payload to the bootloader for further use, e.g. for flashing.
     * Upload a payload to the bootloader for later use, e.g. flashing.
     * Does not handle raw images, flashing, or splitting.
     *
     * @param {string} partition - Name of the partition the payload is intended for.
+1 −1

File changed.

Preview size limit exceeded, changes collapsed.

+1 −1

File changed.

Preview size limit exceeded, changes collapsed.

+1 −1

File changed.

Preview size limit exceeded, changes collapsed.

+1 −1

File changed.

Preview size limit exceeded, changes collapsed.

Loading