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 |
getModel()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 |
isEventSupported(code: Int)Returns if the given event is supported by the device or not. |
| open Boolean |
isOperationSupported(code: Int)Returns if the given operation is supported by the device or not. |
Public methods
getEventsSupported
fun getEventsSupported(): IntArray
Returns event code supported by the device.
| Return | |
|---|---|
IntArray |
supported event code. Can be null if device does not provide the property. |
See Also
android.mtp.MtpEvent#EVENT_UNDEFINEDandroid.mtp.MtpEvent#EVENT_CANCEL_TRANSACTIONandroid.mtp.MtpEvent#EVENT_OBJECT_ADDEDandroid.mtp.MtpEvent#EVENT_OBJECT_REMOVEDandroid.mtp.MtpEvent#EVENT_STORE_ADDEDandroid.mtp.MtpEvent#EVENT_STORE_REMOVEDandroid.mtp.MtpEvent#EVENT_DEVICE_PROP_CHANGEDandroid.mtp.MtpEvent#EVENT_OBJECT_INFO_CHANGEDandroid.mtp.MtpEvent#EVENT_DEVICE_INFO_CHANGEDandroid.mtp.MtpEvent#EVENT_REQUEST_OBJECT_TRANSFERandroid.mtp.MtpEvent#EVENT_STORE_FULLandroid.mtp.MtpEvent#EVENT_DEVICE_RESETandroid.mtp.MtpEvent#EVENT_STORAGE_INFO_CHANGEDandroid.mtp.MtpEvent#EVENT_CAPTURE_COMPLETEandroid.mtp.MtpEvent#EVENT_UNREPORTED_STATUSandroid.mtp.MtpEvent#EVENT_OBJECT_PROP_CHANGEDandroid.mtp.MtpEvent#EVENT_OBJECT_PROP_DESC_CHANGEDandroid.mtp.MtpEvent#EVENT_OBJECT_REFERENCES_CHANGED
getManufacturer
fun getManufacturer(): String
Returns the manufacturer's name for the MTP device
| Return | |
|---|---|
String |
the manufacturer name This value cannot be null. |
getModel
fun getModel(): String
Returns the model name for the MTP device
| Return | |
|---|---|
String |
the model name This value cannot be null. |
getOperationsSupported
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
android.mtp.MtpConstants#OPERATION_GET_DEVICE_INFOandroid.mtp.MtpConstants#OPERATION_OPEN_SESSIONandroid.mtp.MtpConstants#OPERATION_CLOSE_SESSIONandroid.mtp.MtpConstants#OPERATION_GET_STORAGE_I_DSandroid.mtp.MtpConstants#OPERATION_GET_STORAGE_INFOandroid.mtp.MtpConstants#OPERATION_GET_NUM_OBJECTSandroid.mtp.MtpConstants#OPERATION_GET_OBJECT_HANDLESandroid.mtp.MtpConstants#OPERATION_GET_OBJECT_INFOandroid.mtp.MtpConstants#OPERATION_GET_OBJECTandroid.mtp.MtpConstants#OPERATION_GET_THUMBandroid.mtp.MtpConstants#OPERATION_DELETE_OBJECTandroid.mtp.MtpConstants#OPERATION_SEND_OBJECT_INFOandroid.mtp.MtpConstants#OPERATION_SEND_OBJECTandroid.mtp.MtpConstants#OPERATION_INITIATE_CAPTUREandroid.mtp.MtpConstants#OPERATION_FORMAT_STOREandroid.mtp.MtpConstants#OPERATION_RESET_DEVICEandroid.mtp.MtpConstants#OPERATION_SELF_TESTandroid.mtp.MtpConstants#OPERATION_SET_OBJECT_PROTECTIONandroid.mtp.MtpConstants#OPERATION_POWER_DOWNandroid.mtp.MtpConstants#OPERATION_GET_DEVICE_PROP_DESCandroid.mtp.MtpConstants#OPERATION_GET_DEVICE_PROP_VALUEandroid.mtp.MtpConstants#OPERATION_SET_DEVICE_PROP_VALUEandroid.mtp.MtpConstants#OPERATION_RESET_DEVICE_PROP_VALUEandroid.mtp.MtpConstants#OPERATION_TERMINATE_OPEN_CAPTUREandroid.mtp.MtpConstants#OPERATION_MOVE_OBJECTandroid.mtp.MtpConstants#OPERATION_COPY_OBJECTandroid.mtp.MtpConstants#OPERATION_GET_PARTIAL_OBJECTandroid.mtp.MtpConstants#OPERATION_INITIATE_OPEN_CAPTUREandroid.mtp.MtpConstants#OPERATION_GET_OBJECT_PROPS_SUPPORTEDandroid.mtp.MtpConstants#OPERATION_GET_OBJECT_PROP_DESCandroid.mtp.MtpConstants#OPERATION_GET_OBJECT_PROP_VALUEandroid.mtp.MtpConstants#OPERATION_SET_OBJECT_PROP_VALUEandroid.mtp.MtpConstants#OPERATION_GET_OBJECT_REFERENCESandroid.mtp.MtpConstants#OPERATION_SET_OBJECT_REFERENCESandroid.mtp.MtpConstants#OPERATION_SKIP
getSerialNumber
fun getSerialNumber(): String
Returns the unique serial number for the MTP device
| Return | |
|---|---|
String |
the serial number This value cannot be null. |
getVersion
fun getVersion(): String
Returns the version string the MTP device
| Return | |
|---|---|
String |
the device version This value cannot be null. |
isEventSupported
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
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. |