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

Commit 5eaa5bc0 authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge "adb: remove SendConnectOnHost."

parents 8c853c43 4b5d4da6
Loading
Loading
Loading
Loading
+1 −14
Original line number Diff line number Diff line
@@ -257,19 +257,6 @@ void send_connect(atransport* t) {
    send_packet(cp, t);
}

#if ADB_HOST

void SendConnectOnHost(atransport* t) {
    // Send an empty message before A_CNXN message. This is because the data toggle of the ep_out on
    // host and ep_in on device may not be the same.
    apacket* p = get_apacket();
    CHECK(p);
    send_packet(p, t);
    send_connect(t);
}

#endif

// qual_overwrite is used to overwrite a qualifier string.  dst is a
// pointer to a char pointer.  It is assumed that if *dst is non-NULL, it
// was malloc'ed and needs to freed.  *dst will be set to a dup of src.
@@ -370,7 +357,7 @@ void handle_packet(apacket *p, atransport *t)
        if (p->msg.arg0){
            send_packet(p, t);
#if ADB_HOST
            SendConnectOnHost(t);
            send_connect(t);
#endif
        } else {
            t->SetConnectionState(kCsOffline);
+0 −3
Original line number Diff line number Diff line
@@ -224,9 +224,6 @@ void handle_online(atransport *t);
void handle_offline(atransport *t);

void send_connect(atransport *t);
#if ADB_HOST
void SendConnectOnHost(atransport* t);
#endif

void parse_banner(const std::string&, atransport* t);

+7 −0
Original line number Diff line number Diff line
@@ -333,6 +333,13 @@ static void process_device(libusb_device* device) {
            return;
        }

        rc = libusb_set_interface_alt_setting(handle.get(), interface_num, 0);
        if (rc != 0) {
            LOG(WARNING) << "failed to set interface alt setting for device '" << device_serial
                         << "'" << libusb_error_name(rc);
            return;
        }

        for (uint8_t endpoint : {bulk_in, bulk_out}) {
            rc = libusb_clear_halt(handle.get(), endpoint);
            if (rc != 0) {
+0 −7
Original line number Diff line number Diff line
@@ -1101,11 +1101,4 @@ std::shared_ptr<RSA> atransport::NextKey() {
    keys_.pop_front();
    return result;
}
bool atransport::SetSendConnectOnError() {
    if (has_send_connect_on_error_) {
        return false;
    }
    has_send_connect_on_error_ = true;
    return true;
}
#endif
+0 −2
Original line number Diff line number Diff line
@@ -122,7 +122,6 @@ class atransport {

#if ADB_HOST
    std::shared_ptr<RSA> NextKey();
    bool SetSendConnectOnError();
#endif

    char token[TOKEN_SIZE] = {};
@@ -181,7 +180,6 @@ private:
    std::atomic<ConnectionState> connection_state_;
#if ADB_HOST
    std::deque<std::shared_ptr<RSA>> keys_;
    bool has_send_connect_on_error_ = false;
#endif

    DISALLOW_COPY_AND_ASSIGN(atransport);
Loading