use of com.android.ddmlib.Client in project android by JetBrains.
the class AndroidProcessChooserDialog method getSelectedClient.
@Nullable
private Client getSelectedClient() {
final TreePath selectionPath = myProcessTree.getSelectionPath();
if (selectionPath == null || selectionPath.getPathCount() < 3) {
return null;
}
DefaultMutableTreeNode selectedNode = (DefaultMutableTreeNode) selectionPath.getPathComponent(2);
final Object obj = selectedNode.getUserObject();
return obj instanceof Client ? (Client) obj : null;
}
use of com.android.ddmlib.Client in project platform_frameworks_base by android.
the class ReloadListAction method run.
@Override
public void run() {
Client[] clients = clientUtils.findAllClients(device);
if (clients != null) {
Arrays.sort(clients, new ClientComparator());
}
clientListModel.removeAllElements();
for (Client c : clients) {
clientListModel.addElement(c);
}
}
use of com.android.ddmlib.Client in project platform_frameworks_base by android.
the class ScanPackageAction method run.
@Override
public void run() {
Main.getUI().showWaitDialog();
try {
Client client = Main.getUI().getSelectedClient();
if (client != null) {
work(client);
} else {
Client[] clients = clientUtils.findAllClients(device);
if (clients.length > 0) {
ClientWrapper[] clientWrappers = new ClientWrapper[clients.length];
for (int i = 0; i < clientWrappers.length; i++) {
clientWrappers[i] = new ClientWrapper(clients[i]);
}
Main.getUI().hideWaitDialog();
ClientWrapper ret = Main.getUI().showChoiceDialog("Choose a package to scan", "Choose package", clientWrappers);
if (ret != null) {
work(ret.client);
}
}
}
} finally {
Main.getUI().hideWaitDialog();
}
}
use of com.android.ddmlib.Client in project android by JetBrains.
the class GpuSampler method setGpuProfileSetting.
private void setGpuProfileSetting(boolean newSetting) {
if (myGpuProfileSetting != newSetting) {
myGpuProfileSetting = newSetting;
Client client = getClient();
if ((client != null) && (myProfileStateListener != null)) {
myProfileStateListener.notifyGpuProfileStateChanged(client, myGpuProfileSetting);
}
}
}
use of com.android.ddmlib.Client in project android by JetBrains.
the class GpuSampler method prepareSampler.
@Override
protected synchronized void prepareSampler() {
Client client = getClient();
if (client != null) {
int newApiLevel = decodeApiLevel(client);
boolean createNewTimelineData = false;
if (newApiLevel != myApiLevel) {
myApiLevel = newApiLevel;
for (GfxinfoHandler handler : myGfxinfoHandlers) {
if (handler.accept(client)) {
createNewTimelineData = true;
break;
}
}
}
for (GfxinfoHandler handler : myGfxinfoHandlers) {
if (handler.accept(client)) {
myCurrentGfxinfoHandler = handler;
// Do not break here, as we will rely on the ordering of samplers to find the preferred sampler.
}
}
if (createNewTimelineData) {
setTimelineData(myCurrentGfxinfoHandler.createTimelineData());
}
} else {
myCurrentGfxinfoHandler = null;
}
setGpuProfileSetting(true);
if (myCurrentGfxinfoHandler != null) {
myCurrentGfxinfoHandler.setClient(client);
}
getTimelineData().clear();
}
Aggregations