FileDocCategorySizeDatePackage
UsbAccessory.javaAPI DocAndroid 5.1 API4204Thu Mar 12 22:22:30 GMT 2015com.android.future.usb

UsbAccessory

public class UsbAccessory extends Object
A class representing a USB accessory.

Fields Summary
private final String
mManufacturer
private final String
mModel
private final String
mDescription
private final String
mVersion
private final String
mUri
private final String
mSerial
Constructors Summary
UsbAccessory(android.hardware.usb.UsbAccessory accessory)

        mManufacturer = accessory.getManufacturer();
        mModel = accessory.getModel();
        mDescription = accessory.getDescription();
        mVersion = accessory.getVersion();
        mUri = accessory.getUri();
        mSerial = accessory.getSerial();
    
Methods Summary
private static booleancompare(java.lang.String s1, java.lang.String s2)

        if (s1 == null) return (s2 == null);
        return s1.equals(s2);
    
public booleanequals(java.lang.Object obj)

        if (obj instanceof UsbAccessory) {
            UsbAccessory accessory = (UsbAccessory)obj;
            return (compare(mManufacturer, accessory.getManufacturer()) &&
                    compare(mModel, accessory.getModel()) &&
                    compare(mDescription, accessory.getDescription()) &&
                    compare(mVersion, accessory.getVersion()) &&
                    compare(mUri, accessory.getUri()) &&
                    compare(mSerial, accessory.getSerial()));
        }
        return false;
    
public java.lang.StringgetDescription()
Returns a user visible description of the accessory.

return
the accessory description

        return mDescription;
    
public java.lang.StringgetManufacturer()
Returns the manufacturer of the accessory.

return
the accessory manufacturer

        return mManufacturer;
    
public java.lang.StringgetModel()
Returns the model name of the accessory.

return
the accessory model

        return mModel;
    
public java.lang.StringgetSerial()
Returns the unique serial number for the accessory. This is an optional serial number that can be used to differentiate between individual accessories of the same model and manufacturer

return
the unique serial number

        return mSerial;
    
public java.lang.StringgetUri()
Returns the URI for the accessory. This is an optional URI that might show information about the accessory or provide the option to download an application for the accessory

return
the accessory URI

        return mUri;
    
public java.lang.StringgetVersion()
Returns the version of the accessory.

return
the accessory version

        return mVersion;
    
public inthashCode()

        return ((mManufacturer == null ? 0 : mManufacturer.hashCode()) ^
                (mModel == null ? 0 : mModel.hashCode()) ^
                (mDescription == null ? 0 : mDescription.hashCode()) ^
                (mVersion == null ? 0 : mVersion.hashCode()) ^
                (mUri == null ? 0 : mUri.hashCode()) ^
                (mSerial == null ? 0 : mSerial.hashCode()));
    
public java.lang.StringtoString()

        return "UsbAccessory[mManufacturer=" + mManufacturer +
                            ", mModel=" + mModel +
                            ", mDescription=" + mDescription +
                            ", mVersion=" + mVersion +
                            ", mUri=" + mUri +
                            ", mSerial=" + mSerial + "]";