Search in sources :

Example 11 with Client

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

Example 12 with Client

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

Example 13 with Client

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

Example 14 with Client

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

Example 15 with Client

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");
    }
}
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