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

Commit 0469d2c3 authored by Android (Google) Code Review's avatar Android (Google) Code Review
Browse files

Merge change 2282 into donut

* changes:
  Support for 3rd party USB Vendor IDs in adb.
parents 4919d556 a481d096
Loading
Loading
Loading
Loading
+0 −3
Original line number Original line Diff line number Diff line
@@ -919,9 +919,6 @@ int adb_main(int is_daemon)
    fdevent_loop();
    fdevent_loop();


    usb_cleanup();
    usb_cleanup();
#if ADB_HOST
    usb_vendors_cleanup();
#endif


    return 0;
    return 0;
}
}
+3 −4
Original line number Original line Diff line number Diff line
@@ -357,11 +357,10 @@ typedef enum {
#define ADB_PORT 5037
#define ADB_PORT 5037
#define ADB_LOCAL_TRANSPORT_PORT 5555
#define ADB_LOCAL_TRANSPORT_PORT 5555


// Google's USB Vendor ID
#define ADB_CLASS              0xff
#define VENDOR_ID_GOOGLE        0x18d1
#define ADB_SUBCLASS           0x42
#define ADB_PROTOCOL           0x1


// HTC's USB Vendor ID
#define VENDOR_ID_HTC           0x0bb4


void local_init();
void local_init();
int  local_connect(int  port);
int  local_connect(int  port);
+1 −1
Original line number Original line Diff line number Diff line
@@ -213,7 +213,7 @@ int adb_connect(const char *service)
            fprintf(stdout,"* daemon started successfully *\n");
            fprintf(stdout,"* daemon started successfully *\n");
        }
        }
        /* give the server some time to start properly and detect devices */
        /* give the server some time to start properly and detect devices */
        adb_sleep_ms(2000);
        adb_sleep_ms(3000);
        // fall through to _adb_connect
        // fall through to _adb_connect
    } else {
    } else {
        // if server was running, check its version to make sure it is not out of date
        // if server was running, check its version to make sure it is not out of date
+3 −5
Original line number Original line Diff line number Diff line
@@ -135,12 +135,10 @@ int is_adb_interface(int vid, int pid, int usb_class, int usb_subclass, int usb_
    unsigned i;
    unsigned i;
    for (i = 0; i < vendorIdCount; i++) {
    for (i = 0; i < vendorIdCount; i++) {
        if (vid == vendorIds[i]) {
        if (vid == vendorIds[i]) {
            /* class:vendor (0xff) subclass:android (0x42) proto:adb (0x01) */
            if (usb_class == ADB_CLASS && usb_subclass == ADB_SUBCLASS &&
            if(usb_class == 0xff) {
                    usb_protocol == ADB_PROTOCOL) {
                if((usb_subclass == 0x42) && (usb_protocol == 0x01)) {
                return 1;
                return 1;
            }
            }
            }


            return 0;
            return 0;
        }
        }
+0 −3
Original line number Original line Diff line number Diff line
@@ -32,9 +32,6 @@


#define  DBG   D
#define  DBG   D


#define ADB_SUBCLASS           0x42
#define ADB_PROTOCOL           0x1

static IONotificationPortRef    notificationPort = 0;
static IONotificationPortRef    notificationPort = 0;
static io_iterator_t*           notificationIterators;
static io_iterator_t*           notificationIterators;


Loading