Search in sources :

Example 46 with Client

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

Example 47 with 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();
    }
}
Also used : Client(com.android.ddmlib.Client) DumpData(com.android.preload.DumpData) Date(java.util.Date)

Example 48 with Client

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

Example 49 with Client

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

Aggregations

Client (com.android.ddmlib.Client)49 IDevice (com.android.ddmlib.IDevice)6 DumpData (com.android.preload.DumpData)5 Date (java.util.Date)5 AndroidDebugBridge (com.android.ddmlib.AndroidDebugBridge)3 ProcessHandler (com.intellij.execution.process.ProcessHandler)3 IOException (java.io.IOException)3 ClientData (com.android.ddmlib.ClientData)2 Project (com.intellij.openapi.project.Project)2 CountDownLatch (java.util.concurrent.CountDownLatch)2 DefaultMutableTreeNode (javax.swing.tree.DefaultMutableTreeNode)2 TreePath (javax.swing.tree.TreePath)2 Nullable (org.jetbrains.annotations.Nullable)2 IClientChangeListener (com.android.ddmlib.AndroidDebugBridge.IClientChangeListener)1 NullOutputReceiver (com.android.ddmlib.NullOutputReceiver)1 InstantRunClient (com.android.tools.fd.client.InstantRunClient)1 InstantRunPushFailedException (com.android.tools.fd.client.InstantRunPushFailedException)1 HierarchyViewAction (com.android.tools.idea.ddms.actions.HierarchyViewAction)1 GfxinfoHandler (com.android.tools.idea.monitor.gpu.gfxinfohandlers.GfxinfoHandler)1 AllocationTrackingSample (com.android.tools.idea.monitor.ui.memory.model.AllocationTrackingSample)1