本文整理汇总了Java中com.android.ddmlib.ClientData.DebuggerStatus类的典型用法代码示例。如果您正苦于以下问题:Java DebuggerStatus类的具体用法?Java DebuggerStatus怎么用?Java DebuggerStatus使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
DebuggerStatus类属于com.android.ddmlib.ClientData包,在下文中一共展示了DebuggerStatus类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: closeData
import com.android.ddmlib.ClientData.DebuggerStatus; //导入依赖的package包/类
/**
* Close the data connection only.
*/
synchronized void closeData() {
try {
if (mChannel != null) {
mChannel.close();
mChannel = null;
mConnState = ST_NOT_CONNECTED;
ClientData cd = mClient.getClientData();
cd.setDebuggerConnectionStatus(DebuggerStatus.DEFAULT);
mClient.update(Client.CHANGE_DEBUGGER_STATUS);
}
} catch (IOException ioe) {
Log.w("ddms", "Failed to close data " + this);
}
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:19,代码来源:Debugger.java
示例2: createClient
import com.android.ddmlib.ClientData.DebuggerStatus; //导入依赖的package包/类
/**
* Creates a client and register it to the monitor thread
* @param device
* @param pid
* @param socket
* @param debuggerPort the debugger port.
* @param monitorThread the {@link MonitorThread} object.
*/
private void createClient(Device device, int pid, SocketChannel socket, int debuggerPort,
MonitorThread monitorThread) {
/*
* Successfully connected to something. Create a Client object, add
* it to the list, and initiate the JDWP handshake.
*/
Client client = new Client(device, socket, pid);
if (client.sendHandshake()) {
try {
if (AndroidDebugBridge.getClientSupport()) {
client.listenForDebugger(debuggerPort);
}
} catch (IOException ioe) {
client.getClientData().setDebuggerConnectionStatus(DebuggerStatus.ERROR);
Log.e("ddms", "Can't bind to local " + debuggerPort + " for debugger");
// oh well
}
client.requestAllocationStatus();
} else {
Log.e("ddms", "Handshake with " + client + " failed!");
/*
* The handshake send failed. We could remove it now, but if the
* failure is "permanent" we'll just keep banging on it and
* getting the same result. Keep it in the list with its "error"
* state so we don't try to reopen it.
*/
}
if (client.isValid()) {
device.addClient(client);
monitorThread.addClient(client);
} else {
client = null;
}
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:48,代码来源:DeviceMonitor.java
示例3: createClient
import com.android.ddmlib.ClientData.DebuggerStatus; //导入依赖的package包/类
/**
* Creates a client and register it to the monitor thread
*/
private static void createClient(@NonNull Device device, int pid, @NonNull SocketChannel socket,
int debuggerPort, @NonNull MonitorThread monitorThread) {
/*
* Successfully connected to something. Create a Client object, add
* it to the list, and initiate the JDWP handshake.
*/
Client client = new Client(device, socket, pid);
if (client.sendHandshake()) {
try {
if (AndroidDebugBridge.getClientSupport()) {
client.listenForDebugger(debuggerPort);
String msg = String.format(Locale.US, "Opening a debugger listener at port %1$d for client with pid %2$d",
debuggerPort, pid);
Log.i("ddms", msg);
}
} catch (IOException ioe) {
client.getClientData().setDebuggerConnectionStatus(DebuggerStatus.ERROR);
Log.e("ddms", "Can't bind to local " + debuggerPort + " for debugger");
// oh well
}
client.requestAllocationStatus();
} else {
Log.e("ddms", "Handshake with " + client + " failed!");
/*
* The handshake send failed. We could remove it now, but if the
* failure is "permanent" we'll just keep banging on it and
* getting the same result. Keep it in the list with its "error"
* state so we don't try to reopen it.
*/
}
if (client.isValid()) {
device.addClient(client);
monitorThread.addClient(client);
}
}
开发者ID:rock3r,项目名称:framer,代码行数:44,代码来源:DeviceMonitor.java
示例4: getJdwpPacket
import com.android.ddmlib.ClientData.DebuggerStatus; //导入依赖的package包/类
/**
* Return information for the first full JDWP packet in the buffer.
*
* If we don't yet have a full packet, return null.
*
* If we haven't yet received the JDWP handshake, we watch for it here
* and consume it without admitting to have done so. We also send
* the handshake response to the debugger, along with any pending
* pre-connection data, which is why this can throw an IOException.
*/
JdwpPacket getJdwpPacket() throws IOException {
/*
* On entry, the data starts at offset 0 and ends at "position".
* "limit" is set to the buffer capacity.
*/
if (mConnState == ST_AWAIT_SHAKE) {
int result;
result = JdwpPacket.findHandshake(mReadBuffer);
//Log.v("ddms", "findHand: " + result);
switch (result) {
case JdwpPacket.HANDSHAKE_GOOD:
Log.d("ddms", "Good handshake from debugger");
JdwpPacket.consumeHandshake(mReadBuffer);
sendHandshake();
mConnState = ST_READY;
ClientData cd = mClient.getClientData();
cd.setDebuggerConnectionStatus(DebuggerStatus.ATTACHED);
mClient.update(Client.CHANGE_DEBUGGER_STATUS);
// see if we have another packet in the buffer
return getJdwpPacket();
case JdwpPacket.HANDSHAKE_BAD:
// not a debugger, throw an exception so we drop the line
Log.d("ddms", "Bad handshake from debugger");
throw new IOException("bad handshake");
case JdwpPacket.HANDSHAKE_NOTYET:
break;
default:
Log.e("ddms", "Unknown packet while waiting for client handshake");
}
return null;
} else if (mConnState == ST_READY) {
if (mReadBuffer.position() != 0) {
Log.v("ddms", "Checking " + mReadBuffer.position() + " bytes");
}
return JdwpPacket.findPacket(mReadBuffer);
} else {
Log.e("ddms", "Receiving data in state = " + mConnState);
}
return null;
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:55,代码来源:Debugger.java
示例5: clientChanged
import com.android.ddmlib.ClientData.DebuggerStatus; //导入依赖的package包/类
/**
* Sent when an existing client information changed.
* <p/>
* This is sent from a non UI thread.
* @param client the updated client.
* @param changeMask the bit mask describing the changed properties. It can contain
* any of the following values: {@link Client#CHANGE_INFO},
* {@link Client#CHANGE_DEBUGGER_STATUS}, {@link Client#CHANGE_THREAD_MODE},
* {@link Client#CHANGE_THREAD_DATA}, {@link Client#CHANGE_HEAP_MODE},
* {@link Client#CHANGE_HEAP_DATA}, {@link Client#CHANGE_NATIVE_HEAP_DATA}
*
* @see IClientChangeListener#clientChanged(Client, int)
*/
@Override
public void clientChanged(final Client client, final int changeMask) {
exec(new Runnable() {
@Override
public void run() {
if (mTree.isDisposed() == false) {
// refresh the client
mTreeViewer.refresh(client);
if ((changeMask & Client.CHANGE_DEBUGGER_STATUS) ==
Client.CHANGE_DEBUGGER_STATUS &&
client.getClientData().getDebuggerConnectionStatus() ==
DebuggerStatus.WAITING) {
// make sure the device is expanded. Normally the setSelection below
// will auto expand, but the children of device may not already exist
// at this time. Forcing an expand will make the TreeViewer create them.
IDevice device = client.getDevice();
if (mTreeViewer.getExpandedState(device) == false) {
mTreeViewer.setExpandedState(device, true);
}
// create and set the selection
TreePath treePath = new TreePath(new Object[] { device, client});
TreeSelection treeSelection = new TreeSelection(treePath);
mTreeViewer.setSelection(treeSelection);
if (mAdvancedPortSupport) {
client.setAsSelectedClient();
}
// notify the listener of a possible selection change.
notifyListeners(device, client);
}
} else {
// tree is disposed, we need to do something.
// lets remove ourselves from the listener.
AndroidDebugBridge.removeDebugBridgeChangeListener(DevicePanel.this);
AndroidDebugBridge.removeDeviceChangeListener(DevicePanel.this);
AndroidDebugBridge.removeClientChangeListener(DevicePanel.this);
}
}
});
}
开发者ID:utds3lab,项目名称:SMVHunter,代码行数:57,代码来源:DevicePanel.java
示例6: handleWAIT
import com.android.ddmlib.ClientData.DebuggerStatus; //导入依赖的package包/类
private static void handleWAIT(Client client, ByteBuffer data) {
byte reason;
reason = data.get();
Log.d("ddm-wait", "WAIT: reason=" + reason);
ClientData cd = client.getClientData();
synchronized (cd) {
cd.setDebuggerConnectionStatus(DebuggerStatus.WAITING);
}
client.update(Client.CHANGE_DEBUGGER_STATUS);
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:16,代码来源:HandleWait.java
注:本文中的com.android.ddmlib.ClientData.DebuggerStatus类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论