use of com.android.ddmlib.Client in project android_frameworks_base by ResurrectionRemix.
the class Main method findAndGetClassData.
public static Map<String, String> findAndGetClassData(IDevice device, String packageName) throws Exception {
Client client = clientUtils.findClient(device, packageName, -1);
if (client == null) {
throw new RuntimeException("Could not find client...");
}
System.out.println("Found client: " + client);
return getClassDataRetriever().getClassData(client);
}
use of com.android.ddmlib.Client in project android_frameworks_base by crdroidandroid.
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_frameworks_base by crdroidandroid.
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 crdroidandroid.
the class Main method findAndGetClassData.
public static Map<String, String> findAndGetClassData(IDevice device, String packageName) throws Exception {
Client client = clientUtils.findClient(device, packageName, -1);
if (client == null) {
throw new RuntimeException("Could not find client...");
}
System.out.println("Found client: " + client);
return getClassDataRetriever().getClassData(client);
}
Aggregations