FastbootHelper
public
class
FastbootHelper
extends Object
| java.lang.Object | |
| ↳ | com.android.tradefed.device.FastbootHelper |
用于执行 Fastboot 操作的辅助类。
摘要
公共构造函数 | |
|---|---|
FastbootHelper(IRunUtil runUtil, String fastbootPath)
构造函数。 |
|
公共方法 | |
|---|---|
String
|
executeCommand(String serial, String command)
在设备上执行 Fastboot 命令并返回输出。 |
Map<String, Boolean>
|
getBootloaderAndFastbootdDevices()
返回设备序列号的映射以及设备是否处于 fastbootd 模式。 |
Map<String, Boolean>
|
getBootloaderAndFastbootdTcpDevices(Map<String, String> serials)
返回设备序列号的映射以及设备是否处于 fastbootd 模式。 |
Set<String>
|
getDevices()
返回处于 Fastboot 模式的设备序列号集;如果没有 Fastboot 设备,则返回空集。 |
boolean
|
isFastbootAvailable()
确定 Fastboot 是否可供使用。 |
boolean
|
isFastbootd(String serial)
返回设备是否处于 Fastbootd 模式而非引导加载程序模式。 |
公共构造函数
FastbootHelper
public FastbootHelper (IRunUtil runUtil, String fastbootPath)
构造函数。
| 参数 | |
|---|---|
runUtil |
IRunUtil:一个 IRunUtil。 |
fastbootPath |
String |
公共方法
executeCommand
public String executeCommand (String serial,
String command)在设备上执行 Fastboot 命令并返回输出。
| 参数 | |
|---|---|
serial |
String:设备序列号。 |
command |
String:要运行的 Fastboot 命令。 |
| 返回 | |
|---|---|
String |
Fastboot 命令的输出。如果命令失败,则返回 null。 |
getBootloaderAndFastbootdDevices
public Map<String, Boolean> getBootloaderAndFastbootdDevices ()
返回设备序列号的映射以及设备是否处于 fastbootd 模式。
| 返回 | |
|---|---|
Map<String, Boolean> |
引导加载程序或 fastbootd 中的序列号的映射;如果处于 fastbootd 模式,则布尔值为 true |
getBootloaderAndFastbootdTcpDevices
public Map<String, Boolean> getBootloaderAndFastbootdTcpDevices (Map<String, String> serials)
返回设备序列号的映射以及设备是否处于 fastbootd 模式。
| 参数 | |
|---|---|
serials |
Map:设备序列号和 Fastboot 模式序列号的映射。 |
| 返回 | |
|---|---|
Map<String, Boolean> |
引导加载程序或 fastbootd 中的序列号的映射;如果处于 fastbootd 模式,则布尔值为 true |
getDevices
public Set<String> getDevices ()
返回处于 Fastboot 模式的设备序列号集;如果没有 Fastboot 设备,则返回空集。
| 返回 | |
|---|---|
Set<String> |
设备序列号集。 |
isFastbootAvailable
public boolean isFastbootAvailable ()
确定 Fastboot 是否可供使用。
| 返回 | |
|---|---|
boolean |
|
isFastbootd
public boolean isFastbootd (String serial)
返回设备是否处于 Fastbootd 模式而非引导加载程序模式。
| 参数 | |
|---|---|
serial |
String |
| 返回值 | |
|---|---|
boolean |
|