Most visited

Recently visited

Added in API level 12

MtpDeviceInfo

public class MtpDeviceInfo
extends Object

java.lang.Object
    android.mtp.MtpDeviceInfo


该类封装有关MTP设备的信息。 这对应于MTP规范的5.1.1节中描述的DeviceInfo数据集。

摘要(Summary)

公共方法(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

公共方法(Public methods)

getManufacturer

Added in API level 12
String getManufacturer ()

返回MTP设备的制造商名称

返回(Returns)
String the manufacturer name

getModel

Added in API level 12
String getModel ()

返回MTP设备的型号名称

返回(Returns)
String the model name

getSerialNumber

Added in API level 12
String getSerialNumber ()

返回MTP设备的唯一序列号

返回(Returns)
String the serial number

getVersion

Added in API level 12
String getVersion ()

返回MTP设备的版本字符串

返回(Returns)
String the device version

isEventSupported

Added in API level 24
boolean isEventSupported (int code)

返回设备是否支持给定事件。

参数(Parameters)
code int: Event code.
返回(Returns)
boolean If the given event is supported by the device or not.

isOperationSupported

Added in API level 24
boolean isOperationSupported (int code)

返回设备是否支持给定的操作。

参数(Parameters)
code int: Operation code.
返回(Returns)
boolean If the given operation is supported by the device or not.

Hooray!