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

Commit cb140c04 authored by Jerry Zhang's avatar Jerry Zhang Committed by Gerrit Code Review
Browse files

Merge changes I31e444f3,If07ff05f,If3ba190d

* changes:
  adb: Add io size and zero packet to usb_handle
  adb: Have device usb_handle return io size
  adb: Expose device usb_handle through libadbd
parents a63b3309 cda7c3b2
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -299,6 +299,10 @@ cc_library_static {
        "libqemu_pipe",
        "libbase",
    ],

    export_include_dirs: [
        "daemon/include",
    ],
}

cc_binary {
+1 −1
Original line number Diff line number Diff line
@@ -589,7 +589,7 @@ int usb_write(usb_handle* h, const void* d, int len) {

    int rc = perform_usb_transfer(h, info, std::move(lock));
    LOG(DEBUG) << "usb_write(" << len << ") = " << rc;
    return rc;
    return info->transfer->actual_length;
}

int usb_read(usb_handle* h, void* d, int len) {
+2 −2
Original line number Diff line number Diff line
@@ -418,11 +418,11 @@ int usb_write(usb_handle *h, const void *_data, int len)
    if (h->zero_mask && !(len & h->zero_mask)) {
        // If we need 0-markers and our transfer is an even multiple of the packet size,
        // then send a zero marker.
        return usb_bulk_write(h, _data, 0);
        return usb_bulk_write(h, _data, 0) == 0 ? n : -1;
    }

    D("-- usb_write --");
    return 0;
    return n;
}

int usb_read(usb_handle *h, void *_data, int len)
+2 −2
Original line number Diff line number Diff line
@@ -497,8 +497,8 @@ int usb_write(usb_handle *handle, const void *buf, int len)
        }
    }

    if (0 == result)
        return 0;
    if (!result)
        return len;

    LOG(ERROR) << "usb_write failed with status: " << std::hex << result;
    return -1;
+1 −1
Original line number Diff line number Diff line
@@ -365,7 +365,7 @@ int usb_write(usb_handle* handle, const void* data, int len) {
        }
    }

    return 0;
    return written;

fail:
    // Any failure should cause us to kick the device instead of leaving it a
Loading