本文整理汇总了Java中com.android.ddmlib.IDevice.DeviceState方法的典型用法代码示例。如果您正苦于以下问题:Java IDevice.DeviceState方法的具体用法?Java IDevice.DeviceState怎么用?Java IDevice.DeviceState使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.android.ddmlib.IDevice
的用法示例。
在下文中一共展示了IDevice.DeviceState方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: renderDeviceName
import com.android.ddmlib.IDevice; //导入方法依赖的package包/类
static void renderDeviceName(@NotNull IDevice d, @NotNull ColoredTextContainer component) {
component.setIcon(d.isEmulator() ? AndroidIcons.Ddms.Emulator2 : AndroidIcons.Ddms.RealDevice);
String name;
if (d.isEmulator()) {
String avdName = d.getAvdName();
if (avdName == null) {
avdName = "unknown";
}
name = String.format(" %1$s %2$s ", "Emulator", avdName);
} else {
name = String.format(" %1$s ", DevicePropertyUtil.getModel(d, ""));
}
component.append(d.getSerialNumber(), SimpleTextAttributes.GRAYED_BOLD_ATTRIBUTES);
component.append(name, SimpleTextAttributes.REGULAR_ATTRIBUTES);
IDevice.DeviceState deviceState = d.getState();
if (deviceState != IDevice.DeviceState.ONLINE) {
String state = String.format("[%1$s] ", d.getState());
component.append(state, SimpleTextAttributes.GRAYED_BOLD_ATTRIBUTES);
}
if (deviceState != IDevice.DeviceState.DISCONNECTED && deviceState != IDevice.DeviceState.OFFLINE) {
component.append(DevicePropertyUtil.getBuild(d), SimpleTextAttributes.GRAY_ATTRIBUTES);
}
}
示例2: updateDescription
import com.android.ddmlib.IDevice; //导入方法依赖的package包/类
private void updateDescription() {
final String serNum = this.device.getSerialNumber();
final IDevice.DeviceState state = this.device.getMasterDevice().getState();
this.setShortDescription(NbBundle.getMessage(MobileDeviceNode.class, "HINT_Device",
serNum, state != null ? state.toString() : "(unknown state)"));
}
示例3: updateDescription
import com.android.ddmlib.IDevice; //导入方法依赖的package包/类
private void updateDescription() {
final String serNum = this.device.getSerialNumber();
final IDevice.DeviceState state = this.device.getState();
this.setShortDescription(NbBundle.getMessage(EmulatorDeviceNode.class, "HINT_Device",
serNum, state != null ? state.toString() : "(unknown state)"));
}