|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.android.ddmlib.Client
public class Client
This represents a single client, usually a DAlvik VM process.
This class gives access to basic client information, as well as methods to perform actions on the client. More detailed information, usually updated in real time, can be access through theClientData
class. Each Client
object has its own ClientData
accessed through getClientData()
.
Field Summary | |
---|---|
static int |
CHANGE_DEBUGGER_STATUS
Client change bit mask: debugger status change |
static int |
CHANGE_HEAP_ALLOCATION_STATUS
Client change bit mask: allocation information updated |
static int |
CHANGE_HEAP_ALLOCATIONS
Client change bit mask: allocation information updated |
static int |
CHANGE_HEAP_DATA
Client change bit mask: head data updated |
static int |
CHANGE_HEAP_MODE
Client change bit mask: heap update flag change |
static int |
CHANGE_INFO
Client change bit mask: combination of CHANGE_NAME ,
CHANGE_DEBUGGER_STATUS , and CHANGE_PORT . |
static int |
CHANGE_METHOD_PROFILING_STATUS
Client change bit mask: allocation information updated |
static int |
CHANGE_NAME
Client change bit mask: application name change |
static int |
CHANGE_NATIVE_HEAP_DATA
Client change bit mask: native heap data updated |
static int |
CHANGE_PORT
Client change bit mask: debugger port change |
static int |
CHANGE_THREAD_DATA
Client change bit mask: thread data updated |
static int |
CHANGE_THREAD_MODE
Client change bit mask: thread update flag change |
static int |
CHANGE_THREAD_STACKTRACE
Client change bit mask: thread stack trace updated |
Method Summary | |
---|---|
void |
dumpHprof()
Makes the VM dump an HPROF file |
void |
enableAllocationTracker(boolean enable)
Enables or disables the Allocation tracker for this client. |
void |
executeGarbageCollector()
Forces the client to execute its garbage collector. |
ClientData |
getClientData()
Returns the ClientData object containing this client information. |
int |
getDebuggerListenPort()
Returns the debugger port for this client. |
IDevice |
getDevice()
Returns the IDevice on which this Client is running. |
boolean |
isDdmAware()
Returns true if the client VM is DDM-aware. |
boolean |
isDebuggerAttached()
Returns true if a debugger is currently attached to the client. |
boolean |
isHeapUpdateEnabled()
Returns whether the heap update is enabled. |
boolean |
isSelectedClient()
Returns whether this client is the current selected client, accepting debugger connection on the "selected debugger port". |
boolean |
isThreadUpdateEnabled()
Returns whether the thread update is enabled. |
boolean |
isValid()
Returns whether this Client has a valid connection to the application VM. |
void |
kill()
Sends a kill message to the VM. |
void |
requestAllocationDetails()
Sends a request to the VM to send the information about all the allocations that have happened since the call to enableAllocationTracker(boolean) with enable
set to null . |
void |
requestAllocationStatus()
Sends a request to the VM to send the enable status of the allocation tracking. |
void |
requestMethodProfilingStatus()
Sends a request to the VM to send the enable status of the method profiling. |
boolean |
requestNativeHeapInformation()
Sends a native heap update request. |
void |
requestThreadStackTrace(int threadId)
Sends a thread stack trace update request. |
void |
requestThreadUpdate()
Sends a thread update request. |
void |
setAsSelectedClient()
Sets the client to accept debugger connection on the "selected debugger port". |
void |
setHeapUpdateEnabled(boolean enabled)
Enables or disables the heap update. |
void |
setThreadUpdateEnabled(boolean enabled)
Enables or disables the thread update. |
void |
toggleMethodProfiling()
|
String |
toString()
Returns a string representation of the Client object. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final int CHANGE_NAME
public static final int CHANGE_DEBUGGER_STATUS
public static final int CHANGE_PORT
public static final int CHANGE_THREAD_MODE
public static final int CHANGE_THREAD_DATA
public static final int CHANGE_HEAP_MODE
public static final int CHANGE_HEAP_DATA
public static final int CHANGE_NATIVE_HEAP_DATA
public static final int CHANGE_THREAD_STACKTRACE
public static final int CHANGE_HEAP_ALLOCATIONS
public static final int CHANGE_HEAP_ALLOCATION_STATUS
public static final int CHANGE_METHOD_PROFILING_STATUS
public static final int CHANGE_INFO
CHANGE_NAME
,
CHANGE_DEBUGGER_STATUS
, and CHANGE_PORT
.
Method Detail |
---|
public String toString()
Client
object.
toString
in class Object
public IDevice getDevice()
IDevice
on which this Client is running.
public int getDebuggerListenPort()
public boolean isDdmAware()
true
if the client VM is DDM-aware.
Calling here is only allowed after the connection has been
established.
public boolean isDebuggerAttached()
true
if a debugger is currently attached to the client.
public ClientData getClientData()
ClientData
object containing this client information.
public void executeGarbageCollector()
public void dumpHprof()
public void toggleMethodProfiling()
public void requestMethodProfilingStatus()
ClientData.getAllocationStatus()
.
The notification that the new status is available will be received through
AndroidDebugBridge.IClientChangeListener.clientChanged(Client, int)
with a changeMask
containing the mask CHANGE_HEAP_ALLOCATION_STATUS
.
public void setThreadUpdateEnabled(boolean enabled)
true
the VM will be able to send thread information. Thread information
must be requested with requestThreadUpdate()
.
enabled
- the enable flag.public boolean isThreadUpdateEnabled()
public void requestThreadUpdate()
ClientData.getThreads()
. The notification
that the new data is available will be received through
AndroidDebugBridge.IClientChangeListener.clientChanged(Client, int)
with a changeMask
containing the mask CHANGE_THREAD_DATA
.
public void requestThreadStackTrace(int threadId)
ClientData.getThreads()
and
ThreadInfo.getStackTrace()
.
The notification that the new data is available
will be received through AndroidDebugBridge.IClientChangeListener.clientChanged(Client, int)
with a changeMask
containing the mask CHANGE_THREAD_STACKTRACE
.
public void setHeapUpdateEnabled(boolean enabled)
true
, any GC will cause the client to send its heap information.
The heap information can be accessed by ClientData.getVmHeapData()
.
The notification that the new data is available
will be received through AndroidDebugBridge.IClientChangeListener.clientChanged(Client, int)
with a changeMask
containing the value CHANGE_HEAP_DATA
.
enabled
- the enable flagpublic boolean isHeapUpdateEnabled()
setHeapUpdateEnabled(boolean)
public boolean requestNativeHeapInformation()
ClientData.getNativeAllocationList()
.
The notification that the new data is available will be received through
AndroidDebugBridge.IClientChangeListener.clientChanged(Client, int)
with a changeMask
containing the mask CHANGE_NATIVE_HEAP_DATA
.
public void enableAllocationTracker(boolean enable)
requestAllocationDetails()
will make the VM sends the information about all the
allocations that happened between the enabling and the request.
enable
- requestAllocationDetails()
public void requestAllocationStatus()
ClientData.getAllocationStatus()
.
The notification that the new status is available will be received through
AndroidDebugBridge.IClientChangeListener.clientChanged(Client, int)
with a changeMask
containing the mask CHANGE_HEAP_ALLOCATION_STATUS
.
public void requestAllocationDetails()
enableAllocationTracker(boolean)
with enable
set to null
. This is asynchronous.
The allocation information can be accessed by ClientData.getAllocations()
.
The notification that the new data is available will be received through
AndroidDebugBridge.IClientChangeListener.clientChanged(Client, int)
with a changeMask
containing the mask CHANGE_HEAP_ALLOCATIONS
.
public void kill()
public void setAsSelectedClient()
AndroidDebugBridge.setSelectedClient(Client)
,
DdmPreferences.setSelectedDebugPort(int)
public boolean isSelectedClient()
setAsSelectedClient()
,
AndroidDebugBridge.setSelectedClient(Client)
,
DdmPreferences.setSelectedDebugPort(int)
public boolean isValid()
Client
has a valid connection to the application VM.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |