Merge "Disable vendor id filtering for Linux."
This commit is contained in:
commit
511849507a
2 changed files with 4 additions and 20 deletions
|
|
@ -23,10 +23,6 @@
|
||||||
#define TRACE_TAG TRACE_TRANSPORT
|
#define TRACE_TAG TRACE_TRANSPORT
|
||||||
#include "adb.h"
|
#include "adb.h"
|
||||||
|
|
||||||
#if ADB_HOST
|
|
||||||
#include "usb_vendors.h"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef HAVE_BIG_ENDIAN
|
#ifdef HAVE_BIG_ENDIAN
|
||||||
#define H4(x) (((x) & 0xFF000000) >> 24) | (((x) & 0x00FF0000) >> 8) | (((x) & 0x0000FF00) << 8) | (((x) & 0x000000FF) << 24)
|
#define H4(x) (((x) & 0xFF000000) >> 24) | (((x) & 0x00FF0000) >> 8) | (((x) & 0x0000FF00) << 8) | (((x) & 0x000000FF) << 24)
|
||||||
static inline void fix_endians(apacket *p)
|
static inline void fix_endians(apacket *p)
|
||||||
|
|
@ -131,18 +127,6 @@ void init_usb_transport(atransport *t, usb_handle *h, int state)
|
||||||
#if ADB_HOST
|
#if ADB_HOST
|
||||||
int is_adb_interface(int vid, int pid, int usb_class, int usb_subclass, int usb_protocol)
|
int is_adb_interface(int vid, int pid, int usb_class, int usb_subclass, int usb_protocol)
|
||||||
{
|
{
|
||||||
unsigned i;
|
return (usb_class == ADB_CLASS && usb_subclass == ADB_SUBCLASS && usb_protocol == ADB_PROTOCOL);
|
||||||
for (i = 0; i < vendorIdCount; i++) {
|
|
||||||
if (vid == vendorIds[i]) {
|
|
||||||
if (usb_class == ADB_CLASS && usb_subclass == ADB_SUBCLASS &&
|
|
||||||
usb_protocol == ADB_PROTOCOL) {
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -298,7 +298,7 @@ int builtInVendorIds[] = {
|
||||||
int vendorIds[VENDOR_COUNT_MAX];
|
int vendorIds[VENDOR_COUNT_MAX];
|
||||||
unsigned vendorIdCount = 0;
|
unsigned vendorIdCount = 0;
|
||||||
|
|
||||||
int get_adb_usb_ini(char* buff, size_t len);
|
static int get_adb_usb_ini(char* buff, size_t len);
|
||||||
|
|
||||||
void usb_vendors_init(void)
|
void usb_vendors_init(void)
|
||||||
{
|
{
|
||||||
|
|
@ -348,7 +348,7 @@ void usb_vendors_init(void)
|
||||||
/* Utils methods */
|
/* Utils methods */
|
||||||
|
|
||||||
/* builds the path to the adb vendor id file. returns 0 if success */
|
/* builds the path to the adb vendor id file. returns 0 if success */
|
||||||
int build_path(char* buff, size_t len, const char* format, const char* home)
|
static int build_path(char* buff, size_t len, const char* format, const char* home)
|
||||||
{
|
{
|
||||||
if (snprintf(buff, len, format, home, ANDROID_PATH, ANDROID_ADB_INI) >= (signed)len) {
|
if (snprintf(buff, len, format, home, ANDROID_PATH, ANDROID_ADB_INI) >= (signed)len) {
|
||||||
return 1;
|
return 1;
|
||||||
|
|
@ -358,7 +358,7 @@ int build_path(char* buff, size_t len, const char* format, const char* home)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* fills buff with the path to the adb vendor id file. returns 0 if success */
|
/* fills buff with the path to the adb vendor id file. returns 0 if success */
|
||||||
int get_adb_usb_ini(char* buff, size_t len)
|
static int get_adb_usb_ini(char* buff, size_t len)
|
||||||
{
|
{
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
const char* home = getenv("ANDROID_SDK_HOME");
|
const char* home = getenv("ANDROID_SDK_HOME");
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue