use of com.android.ddmlib.ClientData in project android by JetBrains.
the class GpuSampler method sample.
@Override
protected void sample(boolean forced) throws InterruptedException {
Client client = getClient();
assert client != null;
IDevice device = client.getDevice();
if (device != null) {
try {
ClientData data = client.getClientData();
ThreeState newGpuProfilingState = myCurrentGfxinfoHandler.getIsEnabledOnDevice(device);
if (newGpuProfilingState != ThreeState.UNSURE) {
boolean newGpuBooleanState = newGpuProfilingState.toBoolean();
setGpuProfileSetting(newGpuBooleanState);
}
if (myGpuProfileSetting) {
myCurrentGfxinfoHandler.sample(device, data, getTimelineData());
}
} catch (RuntimeException e) {
throw new InterruptedException("Sample error, interrupting.");
} catch (Exception ignored) {
}
}
}
use of com.android.ddmlib.ClientData in project android by JetBrains.
the class ClientCellRenderer method renderClient.
private static void renderClient(@NotNull Client c, ColoredTextContainer container) {
ClientData cd = c.getClientData();
String name = cd.getClientDescription();
if (name == null) {
return;
}
Pair<String, String> app = splitApplicationName(name);
container.append(app.getFirst(), SimpleTextAttributes.REGULAR_ATTRIBUTES);
container.append(app.getSecond(), SimpleTextAttributes.REGULAR_BOLD_ATTRIBUTES);
if (cd.isValidUserId() && cd.getUserId() != 0) {
container.append(String.format(" (user %1$d)", cd.getUserId()), SimpleTextAttributes.GRAY_ATTRIBUTES);
}
container.append(String.format(" (%1$d)", cd.getPid()), SimpleTextAttributes.GRAY_ATTRIBUTES);
if (!c.isValid()) {
container.append(" [DEAD]", SimpleTextAttributes.GRAYED_BOLD_ATTRIBUTES);
}
}
Aggregations