Search in sources :

Example 1 with ClientData

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) {
        }
    }
}
Also used : ThreeState(com.intellij.util.ThreeState) ClientData(com.android.ddmlib.ClientData) IDevice(com.android.ddmlib.IDevice) Client(com.android.ddmlib.Client)

Example 2 with ClientData

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);
    }
}
Also used : ClientData(com.android.ddmlib.ClientData)

Aggregations

ClientData (com.android.ddmlib.ClientData)2 Client (com.android.ddmlib.Client)1 IDevice (com.android.ddmlib.IDevice)1 ThreeState (com.intellij.util.ThreeState)1