com.android.ddmlib
Class ClientData

java.lang.Object
  extended by com.android.ddmlib.ClientData

public class ClientData
extends Object

Contains the data of a Client.


Nested Class Summary
static class ClientData.AllocationTrackingStatus
           
static class ClientData.DebuggerStatus
           
static class ClientData.HeapData
          Heap Information.
static interface ClientData.IHprofDumpHandler
          Handlers able to act on HPROF dumps.
static interface ClientData.IMethodProfilingHandler
          Handlers able to act on Method profiling info
static class ClientData.MethodProfilingStatus
           
 
Field Summary
static String FEATURE_HPROF
          String for feature allowing to dump hprof files
static String FEATURE_HPROF_STREAMING
          String for feature allowing direct streaming of hprof dumps
static String FEATURE_PROFILING
          String for feature enabling starting/stopping method profiling
static String FEATURE_PROFILING_STREAMING
          String for feature enabling direct streaming of method profiling data
static String HEAP_BYTES_ALLOCATED
          Name of the value representing the number of allocated bytes of the heap, in the Map returned by getVmHeapInfo(int)
static String HEAP_MAX_SIZE_BYTES
          Name of the value representing the max size of the heap, in the Map returned by getVmHeapInfo(int)
static String HEAP_OBJECTS_ALLOCATED
          Name of the value representing the number of objects in the heap, in the Map returned by getVmHeapInfo(int)
static String HEAP_SIZE_BYTES
          Name of the value representing the size of the heap, in the Map returned by getVmHeapInfo(int)
 
Method Summary
 AllocationInfo[] getAllocations()
          Returns the list of tracked allocations.
 ClientData.AllocationTrackingStatus getAllocationStatus()
          Returns the allocation tracking status.
 String getClientDescription()
          Returns the client description.
 ClientData.DebuggerStatus getDebuggerConnectionStatus()
          Returns the debugger connection status.
 List<NativeLibraryMapInfo> getMappedNativeLibraries()
          Returns the list of native libraries mapped in memory for this client.
 ClientData.MethodProfilingStatus getMethodProfilingStatus()
          Returns the method profiling status.
 List<NativeAllocationInfo> getNativeAllocationList()
          Returns the list of NativeAllocationInfo.
 int getPid()
          Returns the process ID.
 ThreadInfo[] getThreads()
          Returns the list of threads as ThreadInfo objects.
 int getTotalNativeMemory()
          Returns the total native memory.
 ClientData.HeapData getVmHeapData()
          Returns the ClientData.HeapData object for the VM.
 Iterator<Integer> getVmHeapIds()
          Returns an iterator over the list of known VM heap ids.
 Map<String,Long> getVmHeapInfo(int heapId)
          Returns the most-recent info values for the specified VM heap.
 String getVmIdentifier()
          Returns the Client's VM identifier.
 boolean hasFeature(String feature)
          Returns true if the Client supports the given feature
 boolean hasPendingHprofDump()
           
 boolean isDdmAware()
          Returns whether the process is DDM-aware.
static void setHprofDumpHandler(ClientData.IHprofDumpHandler handler)
          Sets the handler to receive notifications when an HPROF dump succeeded or failed.
static void setMethodProfilingHandler(ClientData.IMethodProfilingHandler handler)
          Sets the handler to receive notifications when an HPROF dump succeeded or failed.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

HEAP_MAX_SIZE_BYTES

public static final String HEAP_MAX_SIZE_BYTES
Name of the value representing the max size of the heap, in the Map returned by getVmHeapInfo(int)

See Also:
Constant Field Values

HEAP_SIZE_BYTES

public static final String HEAP_SIZE_BYTES
Name of the value representing the size of the heap, in the Map returned by getVmHeapInfo(int)

See Also:
Constant Field Values

HEAP_BYTES_ALLOCATED

public static final String HEAP_BYTES_ALLOCATED
Name of the value representing the number of allocated bytes of the heap, in the Map returned by getVmHeapInfo(int)

See Also:
Constant Field Values

HEAP_OBJECTS_ALLOCATED

public static final String HEAP_OBJECTS_ALLOCATED
Name of the value representing the number of objects in the heap, in the Map returned by getVmHeapInfo(int)

See Also:
Constant Field Values

FEATURE_PROFILING

public static final String FEATURE_PROFILING
String for feature enabling starting/stopping method profiling

See Also:
hasFeature(String), Constant Field Values

FEATURE_PROFILING_STREAMING

public static final String FEATURE_PROFILING_STREAMING
String for feature enabling direct streaming of method profiling data

See Also:
hasFeature(String), Constant Field Values

FEATURE_HPROF

public static final String FEATURE_HPROF
String for feature allowing to dump hprof files

See Also:
hasFeature(String), Constant Field Values

FEATURE_HPROF_STREAMING

public static final String FEATURE_HPROF_STREAMING
String for feature allowing direct streaming of hprof dumps

See Also:
hasFeature(String), Constant Field Values
Method Detail

setHprofDumpHandler

public static void setHprofDumpHandler(ClientData.IHprofDumpHandler handler)
Sets the handler to receive notifications when an HPROF dump succeeded or failed.


setMethodProfilingHandler

public static void setMethodProfilingHandler(ClientData.IMethodProfilingHandler handler)
Sets the handler to receive notifications when an HPROF dump succeeded or failed.


isDdmAware

public boolean isDdmAware()
Returns whether the process is DDM-aware.


getPid

public int getPid()
Returns the process ID.


getVmIdentifier

public String getVmIdentifier()
Returns the Client's VM identifier.


getClientDescription

public String getClientDescription()
Returns the client description.

This is generally the name of the package defined in the AndroidManifest.xml.

Returns:
the client description or null if not the description was not yet sent by the client.

getDebuggerConnectionStatus

public ClientData.DebuggerStatus getDebuggerConnectionStatus()
Returns the debugger connection status.


getVmHeapData

public ClientData.HeapData getVmHeapData()
Returns the ClientData.HeapData object for the VM.


getVmHeapIds

public Iterator<Integer> getVmHeapIds()
Returns an iterator over the list of known VM heap ids.

The caller must synchronize on the ClientData object while iterating.

Returns:
an iterator over the list of heap ids

getVmHeapInfo

public Map<String,Long> getVmHeapInfo(int heapId)
Returns the most-recent info values for the specified VM heap.

Parameters:
heapId - The heap whose info should be returned
Returns:
a map containing the info values for the specified heap. Returns null if the heap ID is unknown.

getThreads

public ThreadInfo[] getThreads()
Returns the list of threads as ThreadInfo objects.

The list is empty until a thread update was requested with Client.requestThreadUpdate().


getNativeAllocationList

public List<NativeAllocationInfo> getNativeAllocationList()
Returns the list of NativeAllocationInfo.

See Also:
Client.requestNativeHeapInformation()

getTotalNativeMemory

public int getTotalNativeMemory()
Returns the total native memory.

See Also:
Client.requestNativeHeapInformation()

getMappedNativeLibraries

public List<NativeLibraryMapInfo> getMappedNativeLibraries()
Returns the list of native libraries mapped in memory for this client.


getAllocationStatus

public ClientData.AllocationTrackingStatus getAllocationStatus()
Returns the allocation tracking status.

See Also:
Client.requestAllocationStatus()

getAllocations

public AllocationInfo[] getAllocations()
Returns the list of tracked allocations.

See Also:
Client.requestAllocationDetails()

hasFeature

public boolean hasFeature(String feature)
Returns true if the Client supports the given feature

Parameters:
feature - The feature to test.
Returns:
true if the feature is supported
See Also:
FEATURE_PROFILING, FEATURE_HPROF

hasPendingHprofDump

public boolean hasPendingHprofDump()

getMethodProfilingStatus

public ClientData.MethodProfilingStatus getMethodProfilingStatus()
Returns the method profiling status.

See Also:
Client.requestMethodProfilingStatus()


Copyright © 2008-2012. All Rights Reserved.