public class MtpDeviceInfo
extends Object
java.lang.Object | |
↳ | android.mtp.MtpDeviceInfo |
该类封装有关MTP设备的信息。 这对应于MTP规范的5.1.1节中描述的DeviceInfo数据集。
Public methods |
|
---|---|
final int[] |
getEventsSupported() 返回设备支持的事件代码。 |
final String |
getManufacturer() 返回MTP设备的制造商名称 |
final String |
getModel() 返回MTP设备的型号名称 |
final int[] |
getOperationsSupported() 返回设备支持的操作代码。 |
final String |
getSerialNumber() 返回MTP设备的唯一序列号 |
final String |
getVersion() 返回MTP设备的版本字符串 |
boolean |
isEventSupported(int code) 返回设备是否支持给定事件。 |
boolean |
isOperationSupported(int code) 返回设备是否支持给定的操作。 |
Inherited methods |
|
---|---|
From class java.lang.Object
|
int[] getEventsSupported ()
返回设备支持的事件代码。
Returns | |
---|---|
int[] |
supported event code. Can be null if device does not provide the property. |
也可以看看:
EVENT_UNDEFINED
EVENT_CANCEL_TRANSACTION
EVENT_OBJECT_ADDED
EVENT_OBJECT_REMOVED
EVENT_STORE_ADDED
EVENT_STORE_REMOVED
EVENT_DEVICE_PROP_CHANGED
EVENT_OBJECT_INFO_CHANGED
EVENT_DEVICE_INFO_CHANGED
EVENT_REQUEST_OBJECT_TRANSFER
EVENT_STORE_FULL
EVENT_DEVICE_RESET
EVENT_STORAGE_INFO_CHANGED
EVENT_CAPTURE_COMPLETE
EVENT_UNREPORTED_STATUS
EVENT_OBJECT_PROP_CHANGED
EVENT_OBJECT_PROP_DESC_CHANGED
EVENT_OBJECT_REFERENCES_CHANGED
String getManufacturer ()
返回MTP设备的制造商名称
Returns | |
---|---|
String |
the manufacturer name |
int[] getOperationsSupported ()
返回设备支持的操作代码。
Returns | |
---|---|
int[] |
supported operation code. Can be null if device does not provide the property. |
也可以看看:
OPERATION_GET_DEVICE_INFO
OPERATION_OPEN_SESSION
OPERATION_CLOSE_SESSION
OPERATION_GET_STORAGE_I_DS
OPERATION_GET_STORAGE_INFO
OPERATION_GET_NUM_OBJECTS
OPERATION_GET_OBJECT_HANDLES
OPERATION_GET_OBJECT_INFO
OPERATION_GET_OBJECT
OPERATION_GET_THUMB
OPERATION_DELETE_OBJECT
OPERATION_SEND_OBJECT_INFO
OPERATION_SEND_OBJECT
OPERATION_INITIATE_CAPTURE
OPERATION_FORMAT_STORE
OPERATION_RESET_DEVICE
OPERATION_SELF_TEST
OPERATION_SET_OBJECT_PROTECTION
OPERATION_POWER_DOWN
OPERATION_GET_DEVICE_PROP_DESC
OPERATION_GET_DEVICE_PROP_VALUE
OPERATION_SET_DEVICE_PROP_VALUE
OPERATION_RESET_DEVICE_PROP_VALUE
OPERATION_TERMINATE_OPEN_CAPTURE
OPERATION_MOVE_OBJECT
OPERATION_COPY_OBJECT
OPERATION_GET_PARTIAL_OBJECT
OPERATION_INITIATE_OPEN_CAPTURE
OPERATION_GET_OBJECT_PROPS_SUPPORTED
OPERATION_GET_OBJECT_PROP_DESC
OPERATION_GET_OBJECT_PROP_VALUE
OPERATION_SET_OBJECT_PROP_VALUE
OPERATION_GET_OBJECT_REFERENCES
OPERATION_SET_OBJECT_REFERENCES
OPERATION_SKIP
String getSerialNumber ()
返回MTP设备的唯一序列号
Returns | |
---|---|
String |
the serial number |
String getVersion ()
返回MTP设备的版本字符串
Returns | |
---|---|
String |
the device version |
boolean isEventSupported (int code)
返回设备是否支持给定事件。
Parameters | |
---|---|
code |
int : Event code. |
Returns | |
---|---|
boolean |
If the given event is supported by the device or not. |
boolean isOperationSupported (int code)
返回设备是否支持给定的操作。
Parameters | |
---|---|
code |
int : Operation code. |
Returns | |
---|---|
boolean |
If the given operation is supported by the device or not. |