Added in API level 12

MtpDeviceInfo


open class MtpDeviceInfo
kotlin.Any
   ↳ 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
IntArray

Returns event code supported by the device.

String

Returns the manufacturer's name for the MTP device

String

Returns the model name for the MTP device

IntArray

Returns operation code supported by the device.

String

Returns the unique serial number for the MTP device

String

Returns the version string the MTP device

open Boolean

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

open Boolean

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

Public methods

getManufacturer

Added in API level 12
fun getManufacturer(): String

Returns the manufacturer's name for the MTP device

Return
String the manufacturer name This value cannot be null.

getModel

Added in API level 12
fun getModel(): String

Returns the model name for the MTP device

Return
String the model name This value cannot be null.

getOperationsSupported

Added in API level 24
fun getOperationsSupported(): IntArray

Returns operation code supported by the device.

Return
IntArray supported operation code. Can be null if device does not provide the property.

See Also

getSerialNumber

Added in API level 12
fun getSerialNumber(): String

Returns the unique serial number for the MTP device

Return
String the serial number This value cannot be null.

getVersion

Added in API level 12
fun getVersion(): String

Returns the version string the MTP device

Return
String the device version This value cannot be null.

isEventSupported

Added in API level 24
open fun isEventSupported(code: Int): Boolean

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

Parameters
code Int: Event code.
Return
Boolean If the given event is supported by the device or not.

isOperationSupported

Added in API level 24
open fun isOperationSupported(code: Int): Boolean

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

Parameters
code Int: Operation code.
Return
Boolean If the given operation is supported by the device or not.