Added in [API level 12](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels) Summary: [Methods](https://developer.android.com/reference/android/mtp/MtpDeviceInfo#pubmethods) \| [Inherited Methods](https://developer.android.com/reference/android/mtp/MtpDeviceInfo#inhmethods)

# MtpDeviceInfo

*** ** * ** ***


`
public


class
MtpDeviceInfo
`


`

extends https://developer.android.com/reference/java/lang/Object


`

`


`

|---|---|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object) ||
| ↳ | android.mtp.MtpDeviceInfo |

<br />

*** ** * ** ***

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[]` | ` https://developer.android.com/reference/android/mtp/MtpDeviceInfo#getEventsSupported()() ` Returns event code supported by the device. |
| ` final https://developer.android.com/reference/java/lang/String` | ` https://developer.android.com/reference/android/mtp/MtpDeviceInfo#getManufacturer()() ` Returns the manufacturer's name for the MTP device |
| ` final https://developer.android.com/reference/java/lang/String` | ` https://developer.android.com/reference/android/mtp/MtpDeviceInfo#getModel()() ` Returns the model name for the MTP device |
| ` final int[]` | ` https://developer.android.com/reference/android/mtp/MtpDeviceInfo#getOperationsSupported()() ` Returns operation code supported by the device. |
| ` final https://developer.android.com/reference/java/lang/String` | ` https://developer.android.com/reference/android/mtp/MtpDeviceInfo#getSerialNumber()() ` Returns the unique serial number for the MTP device |
| ` final https://developer.android.com/reference/java/lang/String` | ` https://developer.android.com/reference/android/mtp/MtpDeviceInfo#getVersion()() ` Returns the version string the MTP device |
| ` boolean` | ` https://developer.android.com/reference/android/mtp/MtpDeviceInfo#isEventSupported(int)(int code) ` Returns if the given event is supported by the device or not. |
| ` boolean` | ` https://developer.android.com/reference/android/mtp/MtpDeviceInfo#isOperationSupported(int)(int code) ` Returns if the given operation is supported by the device or not. |

| ### Inherited methods |
|---|---|
| From class ` https://developer.android.com/reference/java/lang/Object ` |---|---| | ` https://developer.android.com/reference/java/lang/Object` | ` https://developer.android.com/reference/java/lang/Object#clone()() ` Creates and returns a copy of this object. | | ` boolean` | ` https://developer.android.com/reference/java/lang/Object#equals(java.lang.Object)(https://developer.android.com/reference/java/lang/Object obj) ` Indicates whether some other object is "equal to" this one. | | ` void` | ` https://developer.android.com/reference/java/lang/Object#finalize()() ` Called by the garbage collector on an object when garbage collection determines that there are no more references to the object. | | ` final https://developer.android.com/reference/java/lang/Class<?>` | ` https://developer.android.com/reference/java/lang/Object#getClass()() ` Returns the runtime class of this `Object`. | | ` int` | ` https://developer.android.com/reference/java/lang/Object#hashCode()() ` Returns a hash code value for the object. | | ` final void` | ` https://developer.android.com/reference/java/lang/Object#notify()() ` Wakes up a single thread that is waiting on this object's monitor. | | ` final void` | ` https://developer.android.com/reference/java/lang/Object#notifyAll()() ` Wakes up all threads that are waiting on this object's monitor. | | ` https://developer.android.com/reference/java/lang/String` | ` https://developer.android.com/reference/java/lang/Object#toString()() ` Returns a string representation of the object. | | ` final void` | ` https://developer.android.com/reference/java/lang/Object#wait(long,%20int)(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` | ` https://developer.android.com/reference/java/lang/Object#wait(long)(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` | ` https://developer.android.com/reference/java/lang/Object#wait()() ` Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*. | ||

## Public methods

### getEventsSupported

Added in [API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public final int[] getEventsSupported ()
```

Returns event code supported by the device.

<br />

| Returns ||
|---|---|
| `int[]` | supported event code. Can be null if device does not provide the property. <br /> |

**See also:**

- `https://developer.android.com/reference/android/mtp/MtpEvent#EVENT_UNDEFINED`
- `https://developer.android.com/reference/android/mtp/MtpEvent#EVENT_CANCEL_TRANSACTION`
- `https://developer.android.com/reference/android/mtp/MtpEvent#EVENT_OBJECT_ADDED`
- `https://developer.android.com/reference/android/mtp/MtpEvent#EVENT_OBJECT_REMOVED`
- `https://developer.android.com/reference/android/mtp/MtpEvent#EVENT_STORE_ADDED`
- `https://developer.android.com/reference/android/mtp/MtpEvent#EVENT_STORE_REMOVED`
- `https://developer.android.com/reference/android/mtp/MtpEvent#EVENT_DEVICE_PROP_CHANGED`
- `https://developer.android.com/reference/android/mtp/MtpEvent#EVENT_OBJECT_INFO_CHANGED`
- `https://developer.android.com/reference/android/mtp/MtpEvent#EVENT_DEVICE_INFO_CHANGED`
- `https://developer.android.com/reference/android/mtp/MtpEvent#EVENT_REQUEST_OBJECT_TRANSFER`
- `https://developer.android.com/reference/android/mtp/MtpEvent#EVENT_STORE_FULL`
- `https://developer.android.com/reference/android/mtp/MtpEvent#EVENT_DEVICE_RESET`
- `https://developer.android.com/reference/android/mtp/MtpEvent#EVENT_STORAGE_INFO_CHANGED`
- `https://developer.android.com/reference/android/mtp/MtpEvent#EVENT_CAPTURE_COMPLETE`
- `https://developer.android.com/reference/android/mtp/MtpEvent#EVENT_UNREPORTED_STATUS`
- `https://developer.android.com/reference/android/mtp/MtpEvent#EVENT_OBJECT_PROP_CHANGED`
- `https://developer.android.com/reference/android/mtp/MtpEvent#EVENT_OBJECT_PROP_DESC_CHANGED`
- `https://developer.android.com/reference/android/mtp/MtpEvent#EVENT_OBJECT_REFERENCES_CHANGED`

### getManufacturer

Added in [API level 12](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public final String getManufacturer ()
```

Returns the manufacturer's name for the MTP device

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/lang/String` | the manufacturer name. This value cannot be `null`. <br /> |

### getModel

Added in [API level 12](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public final String getModel ()
```

Returns the model name for the MTP device

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/lang/String` | the model name. This value cannot be `null`. <br /> |

### getOperationsSupported

Added in [API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public final int[] getOperationsSupported ()
```

Returns operation code supported by the device.

<br />

| Returns ||
|---|---|
| `int[]` | supported operation code. Can be null if device does not provide the property. <br /> |

**See also:**

- `https://developer.android.com/reference/android/mtp/MtpConstants#OPERATION_GET_DEVICE_INFO`
- `https://developer.android.com/reference/android/mtp/MtpConstants#OPERATION_OPEN_SESSION`
- `https://developer.android.com/reference/android/mtp/MtpConstants#OPERATION_CLOSE_SESSION`
- `https://developer.android.com/reference/android/mtp/MtpConstants#OPERATION_GET_STORAGE_I_DS`
- `https://developer.android.com/reference/android/mtp/MtpConstants#OPERATION_GET_STORAGE_INFO`
- `https://developer.android.com/reference/android/mtp/MtpConstants#OPERATION_GET_NUM_OBJECTS`
- `https://developer.android.com/reference/android/mtp/MtpConstants#OPERATION_GET_OBJECT_HANDLES`
- `https://developer.android.com/reference/android/mtp/MtpConstants#OPERATION_GET_OBJECT_INFO`
- `https://developer.android.com/reference/android/mtp/MtpConstants#OPERATION_GET_OBJECT`
- `https://developer.android.com/reference/android/mtp/MtpConstants#OPERATION_GET_THUMB`
- `https://developer.android.com/reference/android/mtp/MtpConstants#OPERATION_DELETE_OBJECT`
- `https://developer.android.com/reference/android/mtp/MtpConstants#OPERATION_SEND_OBJECT_INFO`
- `https://developer.android.com/reference/android/mtp/MtpConstants#OPERATION_SEND_OBJECT`
- `https://developer.android.com/reference/android/mtp/MtpConstants#OPERATION_INITIATE_CAPTURE`
- `https://developer.android.com/reference/android/mtp/MtpConstants#OPERATION_FORMAT_STORE`
- `https://developer.android.com/reference/android/mtp/MtpConstants#OPERATION_RESET_DEVICE`
- `https://developer.android.com/reference/android/mtp/MtpConstants#OPERATION_SELF_TEST`
- `https://developer.android.com/reference/android/mtp/MtpConstants#OPERATION_SET_OBJECT_PROTECTION`
- `https://developer.android.com/reference/android/mtp/MtpConstants#OPERATION_POWER_DOWN`
- `https://developer.android.com/reference/android/mtp/MtpConstants#OPERATION_GET_DEVICE_PROP_DESC`
- `https://developer.android.com/reference/android/mtp/MtpConstants#OPERATION_GET_DEVICE_PROP_VALUE`
- `https://developer.android.com/reference/android/mtp/MtpConstants#OPERATION_SET_DEVICE_PROP_VALUE`
- `https://developer.android.com/reference/android/mtp/MtpConstants#OPERATION_RESET_DEVICE_PROP_VALUE`
- `https://developer.android.com/reference/android/mtp/MtpConstants#OPERATION_TERMINATE_OPEN_CAPTURE`
- `https://developer.android.com/reference/android/mtp/MtpConstants#OPERATION_MOVE_OBJECT`
- `https://developer.android.com/reference/android/mtp/MtpConstants#OPERATION_COPY_OBJECT`
- `https://developer.android.com/reference/android/mtp/MtpConstants#OPERATION_GET_PARTIAL_OBJECT`
- `https://developer.android.com/reference/android/mtp/MtpConstants#OPERATION_INITIATE_OPEN_CAPTURE`
- `https://developer.android.com/reference/android/mtp/MtpConstants#OPERATION_GET_OBJECT_PROPS_SUPPORTED`
- `https://developer.android.com/reference/android/mtp/MtpConstants#OPERATION_GET_OBJECT_PROP_DESC`
- `https://developer.android.com/reference/android/mtp/MtpConstants#OPERATION_GET_OBJECT_PROP_VALUE`
- `https://developer.android.com/reference/android/mtp/MtpConstants#OPERATION_SET_OBJECT_PROP_VALUE`
- `https://developer.android.com/reference/android/mtp/MtpConstants#OPERATION_GET_OBJECT_REFERENCES`
- `https://developer.android.com/reference/android/mtp/MtpConstants#OPERATION_SET_OBJECT_REFERENCES`
- `https://developer.android.com/reference/android/mtp/MtpConstants#OPERATION_SKIP`

### getSerialNumber

Added in [API level 12](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public final String getSerialNumber ()
```

Returns the unique serial number for the MTP device

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/lang/String` | the serial number. This value cannot be `null`. <br /> |

### getVersion

Added in [API level 12](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public final String getVersion ()
```

Returns the version string the MTP device

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/lang/String` | the device version. This value cannot be `null`. <br /> |

### isEventSupported

Added in [API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public boolean isEventSupported (int code)
```

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

<br />

| Parameters ||
|---|---|
| `code` | `int`: Event code. <br /> |

| Returns ||
|---|---|
| `boolean` | If the given event is supported by the device or not. <br /> |

### isOperationSupported

Added in [API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public boolean isOperationSupported (int code)
```

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

<br />

| Parameters ||
|---|---|
| `code` | `int`: Operation code. <br /> |

| Returns ||
|---|---|
| `boolean` | If the given operation is supported by the device or not. <br /> |