Added in API level 12

MtpDeviceInfo


public class MtpDeviceInfo
extends Object

java.lang.Object
   ↳ android.mtp.MtpDeviceInfo


This class encapsulates information about an MTP device. This corresponds to the DeviceInfo Dataset described in section 5.1.1 of the MTP specification.

Summary

Public methods

final int[] getEventsSupported()

Returns event code supported by the device.

final String getManufacturer()

Returns the manufacturer's name for the MTP device

final String getModel()

Returns the model name for the MTP device

final int[] getOperationsSupported()

Returns operation code supported by the device.

final String getSerialNumber()

Returns the unique serial number for the MTP device

final String getVersion()

Returns the version string the MTP device

boolean isEventSupported(int code)

Returns if the given event is supported by the device or not.

boolean isOperationSupported(int code)

Returns if the given operation is supported by the device or not.

Inherited methods

Object clone()

Creates and returns a copy of this object.

boolean equals(Object obj)

Indicates whether some other object is "equal to" this one.

void finalize()

Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.

final Class<?> getClass()

Returns the runtime class of this Object.

int hashCode()

Returns a hash code value for the object.

final void notify()

Wakes up a single thread that is waiting on this object's monitor.

final void notifyAll()

Wakes up all threads that are waiting on this object's monitor.

String toString()

Returns a string representation of the object.

final void wait(long timeoutMillis, int nanos)

Causes the current thread to wait until it is awakened, typically by being notified or interrupted, or until a certain amount of real time has elapsed.

final void wait(long timeoutMillis)

Causes the current thread to wait until it is awakened, typically by being notified or interrupted, or until a certain amount of real time has elapsed.

final void wait()

Causes the current thread to wait until it is awakened, typically by being notified or interrupted.

Public methods

getManufacturer

Added in API level 12
public final String getManufacturer ()

Returns the manufacturer's name for the MTP device

Returns
String the manufacturer name This value cannot be null.

getModel

Added in API level 12
public final String getModel ()

Returns the model name for the MTP device

Returns
String the model name This value cannot be null.

getOperationsSupported

Added in API level 24
public final int[] getOperationsSupported ()

Returns operation code supported by the device.

Returns
int[] supported operation code. Can be null if device does not provide the property.

See also:

getSerialNumber

Added in API level 12
public final String getSerialNumber ()

Returns the unique serial number for the MTP device

Returns
String the serial number This value cannot be null.

getVersion

Added in API level 12
public final String getVersion ()

Returns the version string the MTP device

Returns
String the device version This value cannot be null.

isEventSupported

Added in API level 24
public boolean isEventSupported (int code)

Returns if the given event is supported by the device or not.

Parameters
code int: Event code.

Returns
boolean If the given event is supported by the device or not.

isOperationSupported

Added in API level 24
public boolean isOperationSupported (int code)

Returns if the given operation is supported by the device or not.

Parameters
code int: Operation code.

Returns
boolean If the given operation is supported by the device or not.