com.android.ddmlib
Class DdmPreferences

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

public final class DdmPreferences
extends java.lang.Object

Preferences for the ddm library.

This class does not handle storing the preferences. It is merely a central point for applications using the ddmlib to override the default values.

Various components of the ddmlib query this class to get their values.

Calls to some set##() methods will update the components using the values right away, while other methods will have no effect once AndroidDebugBridge.init(boolean) has been called.

Check the documentation of each method.


Field Summary
static java.lang.String DEFAULT_ADBHOST_VALUE
           
static int DEFAULT_DEBUG_PORT_BASE
          Default value for the debug port base
static boolean DEFAULT_INITIAL_HEAP_UPDATE
          Default value for heap update flag upon client connection.
static boolean DEFAULT_INITIAL_THREAD_UPDATE
          Default value for thread update flag upon client connection.
static Log.LogLevel DEFAULT_LOG_LEVEL
          Default value for the logcat Log.LogLevel
static int DEFAULT_PROFILER_BUFFER_SIZE_MB
          Default profiler buffer size (megabytes)
static int DEFAULT_SELECTED_DEBUG_PORT
          Default value for the selected client debug port
static int DEFAULT_TIMEOUT
          Default timeout values for adb connection (milliseconds)
static boolean DEFAULT_USE_ADBHOST
          Default values for the use of the ADBHOST environment variable.
 
Method Summary
static java.lang.String getAdbHostValue()
          Returns the value of the ADBHOST variable set by the user.
static int getDebugPortBase()
          Returns the debug port used by the first Client.
static boolean getInitialHeapUpdate()
          Returns the initial Client flag for heap updates.
static boolean getInitialThreadUpdate()
          Returns the initial Client flag for thread updates.
static Log.LogLevel getLogLevel()
          Returns the minimum Log.LogLevel being displayed.
static int getProfilerBufferSizeMb()
          Returns the profiler buffer size (megabytes).
static int getSelectedDebugPort()
          Returns the debug port used by the selected Client.
static int getTimeOut()
          Returns the timeout to be used in adb connections (milliseconds).
static boolean getUseAdbHost()
          Returns a boolean indicating that the user uses or not the variable ADBHOST.
static void setAdbHostValue(java.lang.String adbHostValue)
          Sets the value of the ADBHOST variable.
static void setDebugPortBase(int port)
          Sets the debug port used by the first Client.
static void setInitialHeapUpdate(boolean state)
          Sets the initial Client flag for heap updates.
static void setInitialThreadUpdate(boolean state)
          Sets the initial Client flag for thread updates.
static void setLogLevel(java.lang.String value)
          Sets the minimum Log.LogLevel to display.
static void setProfilerBufferSizeMb(int bufferSizeMb)
          Sets the profiler buffer size value.
static void setSelectedDebugPort(int port)
          Sets the debug port used by the selected Client.
static void setTimeOut(int timeOut)
          Sets the timeout value for adb connection.
static void setUseAdbHost(boolean useAdbHost)
          Sets the value of the boolean indicating that the user uses or not the variable ADBHOST.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_INITIAL_THREAD_UPDATE

public static final boolean DEFAULT_INITIAL_THREAD_UPDATE
Default value for thread update flag upon client connection.

See Also:
Constant Field Values

DEFAULT_INITIAL_HEAP_UPDATE

public static final boolean DEFAULT_INITIAL_HEAP_UPDATE
Default value for heap update flag upon client connection.

See Also:
Constant Field Values

DEFAULT_SELECTED_DEBUG_PORT

public static final int DEFAULT_SELECTED_DEBUG_PORT
Default value for the selected client debug port

See Also:
Constant Field Values

DEFAULT_DEBUG_PORT_BASE

public static final int DEFAULT_DEBUG_PORT_BASE
Default value for the debug port base

See Also:
Constant Field Values

DEFAULT_LOG_LEVEL

public static final Log.LogLevel DEFAULT_LOG_LEVEL
Default value for the logcat Log.LogLevel


DEFAULT_TIMEOUT

public static final int DEFAULT_TIMEOUT
Default timeout values for adb connection (milliseconds)

See Also:
Constant Field Values

DEFAULT_PROFILER_BUFFER_SIZE_MB

public static final int DEFAULT_PROFILER_BUFFER_SIZE_MB
Default profiler buffer size (megabytes)

See Also:
Constant Field Values

DEFAULT_USE_ADBHOST

public static final boolean DEFAULT_USE_ADBHOST
Default values for the use of the ADBHOST environment variable.

See Also:
Constant Field Values

DEFAULT_ADBHOST_VALUE

public static final java.lang.String DEFAULT_ADBHOST_VALUE
See Also:
Constant Field Values
Method Detail

getInitialThreadUpdate

public static boolean getInitialThreadUpdate()
Returns the initial Client flag for thread updates.

See Also:
setInitialThreadUpdate(boolean)

setInitialThreadUpdate

public static void setInitialThreadUpdate(boolean state)
Sets the initial Client flag for thread updates.

This change takes effect right away, for newly created Client objects.


getInitialHeapUpdate

public static boolean getInitialHeapUpdate()
Returns the initial Client flag for heap updates.

See Also:
setInitialHeapUpdate(boolean)

setInitialHeapUpdate

public static void setInitialHeapUpdate(boolean state)
Sets the initial Client flag for heap updates.

If true, the ClientData will automatically be updated with the VM heap information whenever a GC happens.

This change takes effect right away, for newly created Client objects.


getSelectedDebugPort

public static int getSelectedDebugPort()
Returns the debug port used by the selected Client.


setSelectedDebugPort

public static void setSelectedDebugPort(int port)
Sets the debug port used by the selected Client.

This change takes effect right away.

Parameters:
port - the new port to use.

getDebugPortBase

public static int getDebugPortBase()
Returns the debug port used by the first Client. Following clients, will use the next port.


setDebugPortBase

public static void setDebugPortBase(int port)
Sets the debug port used by the first Client.

Once a port is used, the next Client will use port + 1. Quitting applications will release their debug port, and new clients will be able to reuse them.

This must be called before AndroidDebugBridge.init(boolean).


getLogLevel

public static Log.LogLevel getLogLevel()
Returns the minimum Log.LogLevel being displayed.


setLogLevel

public static void setLogLevel(java.lang.String value)
Sets the minimum Log.LogLevel to display.

This change takes effect right away.


getTimeOut

public static int getTimeOut()
Returns the timeout to be used in adb connections (milliseconds).


setTimeOut

public static void setTimeOut(int timeOut)
Sets the timeout value for adb connection.

This change takes effect for newly created connections only.

Parameters:
timeOut - the timeout value (milliseconds).

getProfilerBufferSizeMb

public static int getProfilerBufferSizeMb()
Returns the profiler buffer size (megabytes).


setProfilerBufferSizeMb

public static void setProfilerBufferSizeMb(int bufferSizeMb)
Sets the profiler buffer size value.

Parameters:
bufferSizeMb - the buffer size (megabytes).

getUseAdbHost

public static boolean getUseAdbHost()
Returns a boolean indicating that the user uses or not the variable ADBHOST.


setUseAdbHost

public static void setUseAdbHost(boolean useAdbHost)
Sets the value of the boolean indicating that the user uses or not the variable ADBHOST.

Parameters:
useAdbHost - true if the user uses ADBHOST

getAdbHostValue

public static java.lang.String getAdbHostValue()
Returns the value of the ADBHOST variable set by the user.


setAdbHostValue

public static void setAdbHostValue(java.lang.String adbHostValue)
Sets the value of the ADBHOST variable.

Parameters:
adbHostValue -