Example usage for android.hardware.usb UsbDevice getVendorId

List of usage examples for android.hardware.usb UsbDevice getVendorId

Introduction

In this page you can find the example usage for android.hardware.usb UsbDevice getVendorId.

Prototype

public int getVendorId() 

Source Link

Document

Returns a vendor ID for the device.

Usage

From source file:org.broeuschmeul.android.gps.usb.provider.driver.USBGpsManager.java

private UsbDevice getDeviceFromAttached() {
    debugLog("Checking all connected devices");
    for (UsbDevice connectedDevice : usbManager.getDeviceList().values()) {

        debugLog("Checking device: " + connectedDevice.getProductId() + " " + connectedDevice.getVendorId());

        if (connectedDevice.getVendorId() == gpsVendorId & connectedDevice.getProductId() == gpsProductId) {
            debugLog("Found correct device");

            return connectedDevice;
        }/* ww w.  j  a  va  2 s  .c o m*/
    }

    return null;
}