use of com.android.ddmlib.Client in project android_frameworks_base by ResurrectionRemix.
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_frameworks_base by ResurrectionRemix.
the class ScanAllPackagesAction method run.
@Override
public void run() {
Main.getUI().showWaitDialog();
try {
Client[] clients = clientUtils.findAllClients(device);
for (Client c : clients) {
String pkg = c.getClientData().getClientDescription();
Main.getUI().showWaitDialog();
Main.getUI().updateWaitDialog("Retrieving heap data for " + pkg);
try {
Map<String, String> data = Main.getClassDataRetriever().getClassData(c);
DumpData dumpData = new DumpData(pkg, data, new Date());
dataTableModel.addData(dumpData);
} catch (Exception e) {
e.printStackTrace();
}
}
} finally {
Main.getUI().hideWaitDialog();
}
}
use of com.android.ddmlib.Client in project android by JetBrains.
the class ShowLogcatTask method perform.
@Override
public boolean perform(@NotNull IDevice device, @NotNull LaunchStatus launchStatus, @NotNull ConsolePrinter printer) {
Client client = myApplicationId == null ? null : device.getClient(myApplicationId);
showLogcatConsole(myProject, device, client);
return true;
}
use of com.android.ddmlib.Client in project android by JetBrains.
the class ConnectDebuggerTask method perform.
@Override
public ProcessHandler perform(@NotNull final LaunchInfo launchInfo, @NotNull IDevice device, @NotNull final ProcessHandlerLaunchStatus state, @NotNull final ProcessHandlerConsolePrinter printer) {
logUnsupportedBreakpoints(device.getVersion(), printer);
final Client client = waitForClient(device, state, printer);
if (client == null) {
return null;
}
return UIUtil.invokeAndWaitIfNeeded(new Computable<ProcessHandler>() {
@Override
public ProcessHandler compute() {
return launchDebugger(launchInfo, client, state, printer);
}
});
}
use of com.android.ddmlib.Client in project android by JetBrains.
the class AndroidProcessHandler method deviceChanged.
@Override
public void deviceChanged(@NotNull IDevice device, int changeMask) {
if ((changeMask & IDevice.CHANGE_CLIENT_LIST) != IDevice.CHANGE_CLIENT_LIST) {
return;
}
if (!myDevices.contains(device.getSerialNumber())) {
return;
}
Client client = device.getClient(myApplicationId);
if (client != null) {
addClient(client);
return;
}
// it got killed
if (!myClients.isEmpty()) {
for (Client c : myClients) {
if (device.equals(c.getDevice())) {
stopMonitoring(device);
print("Application terminated.");
return;
}
}
}
if ((System.currentTimeMillis() - myDeviceAdded) > TIMEOUT_MS) {
print("Timed out waiting for process to appear on " + device.getName());
stopMonitoring(device);
} else {
print("Waiting for process to come online");
}
}
Aggregations