[androidsdk-tools] 01/02: Imported Upstream version 22.2+git20130830~92d25d6
Tony Mancill
tmancill at moszumanska.debian.org
Sun Nov 23 23:43:29 GMT 2014
This is an automated email from the git hooks/post-receive script.
tmancill pushed a commit to branch master
in repository androidsdk-tools.
commit 9d085748097709aa23f41fcbcb554515ae400edb
Author: tony mancill <tmancill at debian.org>
Date: Sun Nov 23 15:42:59 2014 -0800
Imported Upstream version 22.2+git20130830~92d25d6
---
common/src/main/java/com/android/SdkConstants.java | 131 +++++++--
.../main/java/com/android/utils}/ArrayUtils.java | 2 +-
.../main/java/com/android/utils/HtmlBuilder.java | 309 +++++++++++++++++++++
.../main/java/com/android/utils}/SparseArray.java | 2 +-
.../java/com/android/utils}/SparseIntArray.java | 2 +-
.../main/java/com/android/xml/AndroidManifest.java | 27 ++
ddmlib/.settings/org.eclipse.jdt.core.prefs | 6 +-
.../main/java/com/android/ddmlib/AdbHelper.java | 38 ++-
.../src/main/java/com/android/ddmlib/Client.java | 73 +++--
.../main/java/com/android/ddmlib/ClientData.java | 12 +-
.../src/main/java/com/android/ddmlib/Device.java | 9 +
.../java/com/android/ddmlib/HandleProfiling.java | 56 +++-
.../src/main/java/com/android/ddmlib/IDevice.java | 49 +---
.../com/android/ddmlib/IShellEnabledDevice.java | 65 +++++
.../com/android/ddmlib/NativeAllocationInfo.java | 41 +--
.../java/com/android/ddmlib/TimeoutException.java | 15 +
.../testrunner/IRemoteAndroidTestRunner.java | 15 +-
.../ddmlib/testrunner/RemoteAndroidTestRunner.java | 31 ++-
ddms/app/.settings/org.eclipse.jdt.core.prefs | 6 +-
ddms/app/ddms.iml | 18 ++
ddms/app/etc/ddms.bat | 18 +-
.../src/main/java/com/android/ddms/UIThread.java | 5 +-
ddms/ddmuilib/.settings/org.eclipse.jdt.core.prefs | 6 +-
ddms/ddmuilib/ddmuilib.iml | 22 ++
.../java/com/android/ddmuilib/DevicePanel.java | 57 +++-
.../java/com/android/ddmuilib/SysinfoPanel.java | 135 +++++----
.../ddmuilib/heap/NativeDiffAllocationInfo.java | 67 +++++
.../ddmuilib/heap/NativeHeapDiffSnapshot.java | 39 ++-
.../com/android/ddmuilib/heap/NativeHeapPanel.java | 49 ++--
.../ddmuilib/heap/NativeHeapProviderByLibrary.java | 3 +
.../ddmuilib/heap/NativeSymbolResolverTask.java | 8 +-
.../ddmuilib/vmtrace/VmTraceOptionsDialog.java | 145 ++++++++++
.../app/.settings/org.eclipse.jdt.core.prefs | 6 +-
hierarchyviewer2/app/etc/hierarchyviewer.bat | 18 +-
.../.settings/org.eclipse.jdt.core.prefs | 6 +-
.../device/DeviceConnection.java | 9 +-
sdklib/.settings/org.eclipse.jdt.core.prefs | 6 +-
.../sdkuilib/.settings/org.eclipse.jdt.core.prefs | 6 +-
sdkmanager/sdkuilib/sdkuilib.iml | 20 ++
.../repository/core/PackagesDiffLogic.java | 2 +-
.../internal/repository/icons/accept_icon16.png | Bin 253 -> 3277 bytes
.../internal/repository/icons/addon_pkg_16.png | Bin 539 -> 529 bytes
.../internal/repository/icons/buildtool_pkg_16.png | Bin 453 -> 425 bytes
.../repository/icons/devman_generic_16.png | Bin 269 -> 2906 bytes
.../repository/icons/devman_manufacturer_16.png | Bin 269 -> 2906 bytes
.../internal/repository/icons/devman_user_16.png | Bin 269 -> 272 bytes
.../internal/repository/icons/doc_pkg_16.png | Bin 296 -> 290 bytes
.../internal/repository/icons/extra_pkg_16.png | Bin 428 -> 540 bytes
.../internal/repository/icons/log_off_16.png | Bin 236 -> 1218 bytes
.../internal/repository/icons/log_on_16.png | Bin 311 -> 468 bytes
.../internal/repository/icons/pkg_incompat_16.png | Bin 454 -> 409 bytes
.../internal/repository/icons/pkg_installed_16.png | Bin 356 -> 563 bytes
.../internal/repository/icons/pkg_new_16.png | Bin 299 -> 262 bytes
.../internal/repository/icons/pkg_update_16.png | Bin 296 -> 553 bytes
.../internal/repository/icons/pkgcat_16.png | Bin 388 -> 1352 bytes
.../internal/repository/icons/platform_pkg_16.png | Bin 460 -> 2981 bytes
.../repository/icons/platformtool_pkg_16.png | Bin 453 -> 393 bytes
.../internal/repository/icons/reject_icon16.png | Bin 317 -> 3367 bytes
.../internal/repository/icons/sample_pkg_16.png | Bin 433 -> 3188 bytes
.../internal/repository/icons/source_pkg_16.png | Bin 234 -> 466 bytes
.../internal/repository/icons/status_ok_16.png | Bin 264 -> 3277 bytes
.../internal/repository/icons/stop_disabled_16.png | Bin 321 -> 809 bytes
.../internal/repository/icons/stop_enabled_16.png | Bin 327 -> 642 bytes
.../internal/repository/icons/sysimg_pkg_16.png | Bin 485 -> 1145 bytes
.../internal/repository/icons/tool_pkg_16.png | Bin 188 -> 393 bytes
.../internal/repository/icons/unknown_icon16.png | Bin 265 -> 453 bytes
.../internal/widgets/AvdCreationDialog.java | 116 +++++---
.../repository/ui/MockPackagesPageImpl.java | 2 +-
.../repository/ui/SdkManagerUpgradeTest.java | 10 +-
sdkstats/.settings/org.eclipse.jdt.core.prefs | 6 +-
sdkstats/sdkstats.iml | 19 ++
swtmenubar/.settings/README.txt | 2 +
.../.settings/org.eclipse.jdt.core.prefs | 6 +-
swtmenubar/swtmenubar.iml | 17 ++
traceview/.classpath | 2 +-
traceview/.settings/org.eclipse.jdt.core.prefs | 6 +-
traceview/etc/traceview.bat | 18 +-
traceview/traceview.iml | 19 ++
.../.settings/org.eclipse.jdt.core.prefs | 6 +-
uiautomatorviewer/etc/uiautomatorviewer.bat | 18 +-
80 files changed, 1444 insertions(+), 337 deletions(-)
diff --git a/common/src/main/java/com/android/SdkConstants.java b/common/src/main/java/com/android/SdkConstants.java
index fdceadb..8a584e9 100644
--- a/common/src/main/java/com/android/SdkConstants.java
+++ b/common/src/main/java/com/android/SdkConstants.java
@@ -47,11 +47,20 @@ public final class SdkConstants {
*/
public static final int CURRENT_PLATFORM = currentPlatform();
+ /** Environment variable that specifies the path of an Android SDK. */
+ public static final String ANDROID_HOME_ENV = "ANDROID_HOME";
+
+ /** Property in local.properties file that specifies the path of the Android SDK. */
+ public static final String SDK_DIR_PROPERTY = "sdk.dir";
+
/**
* Charset for the ini file handled by the SDK.
*/
public static final String INI_CHARSET = "UTF-8"; //$NON-NLS-1$
+ /** Path separator used by Gradle */
+ public static final String GRADLE_PATH_SEPARATOR = ":"; //$NON-NLS-1$
+
/** An SDK Project's AndroidManifest.xml file */
public static final String FN_ANDROID_MANIFEST_XML= "AndroidManifest.xml"; //$NON-NLS-1$
/** pre-dex jar filename. i.e. "classes.jar" */
@@ -61,6 +70,10 @@ public final class SdkConstants {
/** An SDK Project's build.xml file */
public static final String FN_BUILD_XML = "build.xml"; //$NON-NLS-1$
+ /** An SDK Project's build.gradle file */
+ public static final String FN_BUILD_GRADLE = "build.gradle"; //$NON-NLS-1$
+ /** An SDK Project's settings.gradle file */
+ public static final String FN_SETTINGS_GRADLE = "settings.gradle"; //$NON-NLS-1$
/** Name of the framework library, i.e. "android.jar" */
public static final String FN_FRAMEWORK_LIBRARY = "android.jar"; //$NON-NLS-1$
@@ -136,6 +149,22 @@ public final class SdkConstants {
public static final String FN_RENDERSCRIPT =
"llvm-rs-cc" + ext(".exe", ""); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ /** renderscript support exe (with extension for the current OS) */
+ public static final String FN_BCC_COMPAT =
+ "bcc_compat" + ext(".exe", ""); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+
+ /** renderscript support linker for ARM (with extension for the current OS) */
+ public static final String FN_LD_ARM =
+ "arm-linux-androideabi-ld" + ext(".exe", ""); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+
+ /** renderscript support linker for X86 (with extension for the current OS) */
+ public static final String FN_LD_X86 =
+ "i686-linux-android-ld" + ext(".exe", ""); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+
+ /** renderscript support linker for MIPS (with extension for the current OS) */
+ public static final String FN_LD_MIPS =
+ "mipsel-linux-android-ld" + ext(".exe", ""); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+
/** adb executable (with extension for the current OS) */
public static final String FN_ADB =
"adb" + ext(".exe", ""); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
@@ -167,6 +196,9 @@ public final class SdkConstants {
/** properties file for the SDK */
public static final String FN_SDK_PROP = "sdk.properties"; //$NON-NLS-1$
+
+ public static final String FN_RENDERSCRIPT_V8_JAR = "renderscript-v8.jar"; //$NON-NLS-1$
+
/**
* filename for gdbserver.
*/
@@ -190,6 +222,12 @@ public final class SdkConstants {
* Note: this is not the same as {@link #FD_PKG_SOURCES}
* which is an SDK sources folder for packages. */
public static final String FD_SOURCES = "src"; //$NON-NLS-1$
+ /** Default main source set folder name, i.e. "main" */
+ public static final String FD_MAIN = "main"; //$NON-NLS-1$
+ /** Default test source set folder name, i.e. "instrumentTest" */
+ public static final String FD_TEST = "instrumentTest"; //$NON-NLS-1$
+ /** Default java code folder name, i.e. "java" */
+ public static final String FD_JAVA = "java"; //$NON-NLS-1$
/** Default generated source folder name, i.e. "gen" */
public static final String FD_GEN_SOURCES = "gen"; //$NON-NLS-1$
/** Default native library folder name inside the project, i.e. "libs"
@@ -208,6 +246,11 @@ public final class SdkConstants {
/** aidl output folder for copied aidl files */
public static final String FD_AIDL = "aidl"; //$NON-NLS-1$
+ /** rs Libs output folder for support mode */
+ public static final String FD_RS_LIBS = "rsLibs"; //$NON-NLS-1$
+ /** rs Libs output folder for support mode */
+ public static final String FD_RS_OBJ = "rsObj"; //$NON-NLS-1$
+
/* Folder Names for the Android SDK */
/** Name of the SDK platforms folder. */
@@ -355,6 +398,13 @@ public final class SdkConstants {
"proguard" + File.separator + //$NON-NLS-1$
"bin" + File.separator; //$NON-NLS-1$
+ /** Path of the template gradle wrapper folder relative to the sdk folder.
+ * This is an OS path, ending with a separator. */
+ public static final String OS_SDK_TOOLS_TEMPLATES_GRADLE_WRAPPER_FOLDER =
+ OS_SDK_TOOLS_FOLDER + FD_TEMPLATES + File.separator +
+ "gradle" + File.separator + //$NON-NLS-1$
+ "wrapper" + File.separator; //$NON-NLS-1$
+
/* Folder paths relative to a platform or add-on folder */
/** Path of the images directory relative to a platform or addon folder.
@@ -579,7 +629,9 @@ public final class SdkConstants {
public static final String ANDROID_NS_NAME = "android"; //$NON-NLS-1$
/** The default prefix used for the {@link #ANDROID_URI} name space including the colon */
public static final String ANDROID_NS_NAME_PREFIX = "android:"; //$NON-NLS-1$
- /** The default prefix used for the app */
+ public static final int ANDROID_NS_NAME_PREFIX_LEN = ANDROID_NS_NAME_PREFIX.length();
+
+ /** The default prefix used for the app */
public static final String APP_PREFIX = "app"; //$NON-NLS-1$
/** The entity for the ampersand character */
public static final String AMP_ENTITY = "&"; //$NON-NLS-1$
@@ -639,6 +691,10 @@ public final class SdkConstants {
public static final String TAG_DIMEN = "dimen"; //$NON-NLS-1$
public static final String TAG_DRAWABLE = "drawable"; //$NON-NLS-1$
public static final String TAG_MENU = "menu"; //$NON-NLS-1$
+ public static final String TAG_ENUM = "enum"; //$NON-NLS-1$
+ public static final String TAG_FLAG = "flag"; //$NON-NLS-1$
+ public static final String TAG_ATTR = "attr"; //$NON-NLS-1$
+ public static final String TAG_DECLARE_STYLEABLE = "declare-styleable"; //$NON-NLS-1$
// Tags: XML
public static final String TAG_HEADER = "header"; //$NON-NLS-1$
@@ -722,6 +778,9 @@ public final class SdkConstants {
public static final String ATTR_PARENT = "parent"; //$NON-NLS-1$
public static final String ATTR_TRANSLATABLE = "translatable"; //$NON-NLS-1$
public static final String ATTR_COLOR = "color"; //$NON-NLS-1$
+ public static final String ATTR_VALUE = "value"; //$NON-NLS-1$
+ public static final String ATTR_QUANTITY = "quantity"; //$NON-NLS-1$
+ public static final String ATTR_FORMAT = "format"; //$NON-NLS-1$
// Attributes: Layout
public static final String ATTR_LAYOUT_RESOURCE_PREFIX = "layout_";//$NON-NLS-1$
@@ -746,6 +805,8 @@ public final class SdkConstants {
public static final String ATTR_PADDING_TOP = "paddingTop"; //$NON-NLS-1$
public static final String ATTR_PADDING_RIGHT = "paddingRight"; //$NON-NLS-1$
public static final String ATTR_PADDING_LEFT = "paddingLeft"; //$NON-NLS-1$
+ public static final String ATTR_PADDING_START = "paddingStart"; //$NON-NLS-1$
+ public static final String ATTR_PADDING_END = "paddingEnd"; //$NON-NLS-1$
public static final String ATTR_FOREGROUND = "foreground"; //$NON-NLS-1$
public static final String ATTR_BACKGROUND = "background"; //$NON-NLS-1$
public static final String ATTR_ORIENTATION = "orientation"; //$NON-NLS-1$
@@ -780,6 +841,15 @@ public final class SdkConstants {
"textIsSelectable"; //$NON-NLS-1$
public static final String ATTR_IMPORTANT_FOR_ACCESSIBILITY =
"importantForAccessibility"; //$NON-NLS-1$
+ public static final String ATTR_LIST_PREFERRED_ITEM_PADDING_LEFT =
+ "listPreferredItemPaddingLeft"; //$NON-NLS-1$
+ public static final String ATTR_LIST_PREFERRED_ITEM_PADDING_RIGHT =
+ "listPreferredItemPaddingRight"; //$NON-NLS-1$
+ public static final String ATTR_LIST_PREFERRED_ITEM_PADDING_START =
+ "listPreferredItemPaddingStart"; //$NON-NLS-1$
+ public static final String ATTR_LIST_PREFERRED_ITEM_PADDING_END =
+ "listPreferredItemPaddingEnd"; //$NON-NLS-1$
+ public static final String ATTR_INDEX = "index"; //$NON-NLS-1$
// AbsoluteLayout layout params
public static final String ATTR_LAYOUT_Y = "layout_y"; //$NON-NLS-1$
@@ -797,26 +867,34 @@ public final class SdkConstants {
// RelativeLayout layout params:
public static final String ATTR_LAYOUT_ALIGN_LEFT = "layout_alignLeft"; //$NON-NLS-1$
public static final String ATTR_LAYOUT_ALIGN_RIGHT = "layout_alignRight"; //$NON-NLS-1$
+ public static final String ATTR_LAYOUT_ALIGN_START = "layout_alignStart"; //$NON-NLS-1$
+ public static final String ATTR_LAYOUT_ALIGN_END = "layout_alignEnd"; //$NON-NLS-1$
public static final String ATTR_LAYOUT_ALIGN_TOP = "layout_alignTop"; //$NON-NLS-1$
public static final String ATTR_LAYOUT_ALIGN_BOTTOM = "layout_alignBottom"; //$NON-NLS-1$
- public static final String ATTR_LAYOUT_ALIGN_PARENT_TOP = "layout_alignParentTop"; //$NON-NLS-1$
- public static final String ATTR_LAYOUT_ALIGN_PARENT_BOTTOM = "layout_alignParentBottom"; //$NON-NLS-1$
- public static final String ATTR_LAYOUT_ALIGN_PARENT_LEFT = "layout_alignParentLeft";//$NON-NLS-1$
- public static final String ATTR_LAYOUT_ALIGN_PARENT_RIGHT = "layout_alignParentRight"; //$NON-NLS-1$
- public static final String ATTR_LAYOUT_ALIGN_WITH_PARENT_MISSING = "layout_alignWithParentIfMissing"; //$NON-NLS-1$
- public static final String ATTR_LAYOUT_ALIGN_BASELINE = "layout_alignBaseline"; //$NON-NLS-1$
- public static final String ATTR_LAYOUT_CENTER_IN_PARENT = "layout_centerInParent"; //$NON-NLS-1$
- public static final String ATTR_LAYOUT_CENTER_VERTICAL = "layout_centerVertical"; //$NON-NLS-1$
- public static final String ATTR_LAYOUT_CENTER_HORIZONTAL = "layout_centerHorizontal"; //$NON-NLS-1$
- public static final String ATTR_LAYOUT_TO_RIGHT_OF = "layout_toRightOf"; //$NON-NLS-1$
- public static final String ATTR_LAYOUT_TO_LEFT_OF = "layout_toLeftOf"; //$NON-NLS-1$
- public static final String ATTR_LAYOUT_BELOW = "layout_below"; //$NON-NLS-1$
- public static final String ATTR_LAYOUT_ABOVE = "layout_above"; //$NON-NLS-1$
+ public static final String ATTR_LAYOUT_ALIGN_PARENT_LEFT = "layout_alignParentLeft"; //$NON-NLS-1$
+ public static final String ATTR_LAYOUT_ALIGN_PARENT_RIGHT = "layout_alignParentRight"; //$NON-NLS-1$
+ public static final String ATTR_LAYOUT_ALIGN_PARENT_START = "layout_alignParentStart"; //$NON-NLS-1$
+ public static final String ATTR_LAYOUT_ALIGN_PARENT_END = "layout_alignParentEnd"; //$NON-NLS-1$
+ public static final String ATTR_LAYOUT_ALIGN_PARENT_TOP = "layout_alignParentTop"; //$NON-NLS-1$
+ public static final String ATTR_LAYOUT_ALIGN_PARENT_BOTTOM = "layout_alignParentBottom"; //$NON-NLS-1$
+ public static final String ATTR_LAYOUT_ALIGN_WITH_PARENT_MISSING = "layout_alignWithParentIfMissing"; //$NON-NLS-1$
+ public static final String ATTR_LAYOUT_ALIGN_BASELINE = "layout_alignBaseline"; //$NON-NLS-1$
+ public static final String ATTR_LAYOUT_CENTER_IN_PARENT = "layout_centerInParent"; //$NON-NLS-1$
+ public static final String ATTR_LAYOUT_CENTER_VERTICAL = "layout_centerVertical"; //$NON-NLS-1$
+ public static final String ATTR_LAYOUT_CENTER_HORIZONTAL = "layout_centerHorizontal"; //$NON-NLS-1$
+ public static final String ATTR_LAYOUT_TO_RIGHT_OF = "layout_toRightOf"; //$NON-NLS-1$
+ public static final String ATTR_LAYOUT_TO_LEFT_OF = "layout_toLeftOf"; //$NON-NLS-1$
+ public static final String ATTR_LAYOUT_TO_START_OF = "layout_toStartOf"; //$NON-NLS-1$
+ public static final String ATTR_LAYOUT_TO_END_OF = "layout_toEndOf"; //$NON-NLS-1$
+ public static final String ATTR_LAYOUT_BELOW = "layout_below"; //$NON-NLS-1$
+ public static final String ATTR_LAYOUT_ABOVE = "layout_above"; //$NON-NLS-1$
// Margins
public static final String ATTR_LAYOUT_MARGIN = "layout_margin"; //$NON-NLS-1$
public static final String ATTR_LAYOUT_MARGIN_LEFT = "layout_marginLeft"; //$NON-NLS-1$
public static final String ATTR_LAYOUT_MARGIN_RIGHT = "layout_marginRight"; //$NON-NLS-1$
+ public static final String ATTR_LAYOUT_MARGIN_START = "layout_marginStart"; //$NON-NLS-1$
+ public static final String ATTR_LAYOUT_MARGIN_END = "layout_marginEnd"; //$NON-NLS-1$
public static final String ATTR_LAYOUT_MARGIN_TOP = "layout_marginTop"; //$NON-NLS-1$
public static final String ATTR_LAYOUT_MARGIN_BOTTOM = "layout_marginBottom"; //$NON-NLS-1$
@@ -893,8 +971,12 @@ public final class SdkConstants {
public static final String EXT_AIDL = "aidl"; //$NON-NLS-1$
/** Extension of Renderscript files, i.e. "rs" */
public static final String EXT_RS = "rs"; //$NON-NLS-1$
+ /** Extension of Renderscript files, i.e. "rsh" */
+ public static final String EXT_RSH = "rsh"; //$NON-NLS-1$
/** Extension of FilterScript files, i.e. "fs" */
public static final String EXT_FS = "fs"; //$NON-NLS-1$
+ /** Extension of Renderscript bitcode files, i.e. "bc" */
+ public static final String EXT_BC = "bc"; //$NON-NLS-1$
/** Extension of dependency files, i.e. "d" */
public static final String EXT_DEP = "d"; //$NON-NLS-1$
/** Extension of native libraries, i.e. "so" */
@@ -905,6 +987,8 @@ public final class SdkConstants {
public static final String EXT_RES = "ap_"; //$NON-NLS-1$
/** Extension for pre-processable images. Right now pngs */
public static final String EXT_PNG = "png"; //$NON-NLS-1$
+ /** Extension for Android archive files */
+ public static final String EXT_AAR = "aar"; //$NON-NLS-1$
private static final String DOT = "."; //$NON-NLS-1$
@@ -914,8 +998,12 @@ public final class SdkConstants {
public static final String DOT_AIDL = DOT + EXT_AIDL;
/** Dot-Extension of renderscript files, i.e. ".rs" */
public static final String DOT_RS = DOT + EXT_RS;
+ /** Dot-Extension of renderscript header files, i.e. ".rsh" */
+ public static final String DOT_RSH = DOT + EXT_RSH;
/** Dot-Extension of FilterScript files, i.e. ".fs" */
public static final String DOT_FS = DOT + EXT_FS;
+ /** Dot-Extension of renderscript bitcode files, i.e. ".bc" */
+ public static final String DOT_BC = DOT + EXT_BC;
/** Dot-Extension of dependency files, i.e. ".d" */
public static final String DOT_DEP = DOT + EXT_DEP;
/** Dot-Extension of dex files, i.e. ".dex" */
@@ -930,6 +1018,8 @@ public final class SdkConstants {
public static final String DOT_FTL = ".ftl"; //$NON-NLS-1$
/** Dot-Extension of text files, i.e. ".txt" */
public static final String DOT_TXT = ".txt"; //$NON-NLS-1$
+ /** Dot-Extension for Android archive files */
+ public static final String DOT_AAR = DOT + EXT_AAR; //$NON-NLS-1$
/** Resource base name for java files and classes */
public static final String FN_RESOURCE_BASE = "R"; //$NON-NLS-1$
@@ -965,8 +1055,13 @@ public final class SdkConstants {
public static final String ID_PREFIX = "@id/"; //$NON-NLS-1$
public static final String DRAWABLE_PREFIX = "@drawable/"; //$NON-NLS-1$
public static final String STRING_PREFIX = "@string/"; //$NON-NLS-1$
- public static final String ANDROID_STRING_PREFIX = "@android:string/"; //$NON-NLS-1$
+
public static final String ANDROID_LAYOUT_RESOURCE_PREFIX = "@android:layout/"; //$NON-NLS-1$
+ public static final String ANDROID_STYLE_RESOURCE_PREFIX = "@android:style/"; //$NON-NLS-1$
+ public static final String ANDROID_NEW_ID_PREFIX = "@android:+id/"; //$NON-NLS-1$
+ public static final String ANDROID_ID_PREFIX = "@android:id/"; //$NON-NLS-1$
+ public static final String ANDROID_DRAWABLE_PREFIX = "@android:drawable/"; //$NON-NLS-1$
+ public static final String ANDROID_STRING_PREFIX = "@android:string/"; //$NON-NLS-1$
public static final String RESOURCE_CLZ_ID = "id"; //$NON-NLS-1$
public static final String RESOURCE_CLZ_COLOR = "color"; //$NON-NLS-1$
@@ -975,7 +1070,6 @@ public final class SdkConstants {
public static final String RESOURCE_CLR_STYLEABLE = "styleable"; //$NON-NLS-1$
public static final String NULL_RESOURCE = "@null"; //$NON-NLS-1$
public static final String TRANSPARENT_COLOR = "@android:color/transparent"; //$NON-NLS-1$
- public static final String ANDROID_STYLE_RESOURCE_PREFIX = "@android:style/"; //$NON-NLS-1$
public static final String REFERENCE_STYLE = "style/"; //$NON-NLS-1$
public static final String PREFIX_ANDROID = "android:"; //$NON-NLS-1$
@@ -1048,6 +1142,8 @@ public final class SdkConstants {
// TextView
public static final String ATTR_DRAWABLE_RIGHT = "drawableRight"; //$NON-NLS-1$
public static final String ATTR_DRAWABLE_LEFT = "drawableLeft"; //$NON-NLS-1$
+ public static final String ATTR_DRAWABLE_START = "drawableStart"; //$NON-NLS-1$
+ public static final String ATTR_DRAWABLE_END = "drawableEnd"; //$NON-NLS-1$
public static final String ATTR_DRAWABLE_BOTTOM = "drawableBottom"; //$NON-NLS-1$
public static final String ATTR_DRAWABLE_TOP = "drawableTop"; //$NON-NLS-1$
public static final String ATTR_DRAWABLE_PADDING = "drawablePadding"; //$NON-NLS-1$
@@ -1176,7 +1272,8 @@ public final class SdkConstants {
public static final String ATTR_SRC = "src"; //$NON-NLS-1$
- public static final String ATTR_GRAVITY = "gravity"; //$NON-NLS-1$
+ public static final String ATTR_GRAVITY = "gravity"; //$NON-NLS-1$
+
public static final String ATTR_WEIGHT_SUM = "weightSum"; //$NON-NLS-1$
public static final String ATTR_EMS = "ems"; //$NON-NLS-1$
diff --git a/sdklib/src/main/java/com/android/sdklib/util/ArrayUtils.java b/common/src/main/java/com/android/utils/ArrayUtils.java
similarity index 99%
rename from sdklib/src/main/java/com/android/sdklib/util/ArrayUtils.java
rename to common/src/main/java/com/android/utils/ArrayUtils.java
index 787940b..1e08b74 100644
--- a/sdklib/src/main/java/com/android/sdklib/util/ArrayUtils.java
+++ b/common/src/main/java/com/android/utils/ArrayUtils.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package com.android.sdklib.util;
+package com.android.utils;
import java.lang.reflect.Array;
diff --git a/common/src/main/java/com/android/utils/HtmlBuilder.java b/common/src/main/java/com/android/utils/HtmlBuilder.java
new file mode 100644
index 0000000..3c3159e
--- /dev/null
+++ b/common/src/main/java/com/android/utils/HtmlBuilder.java
@@ -0,0 +1,309 @@
+/*
+ * Copyright (C) 2013 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.android.utils;
+
+import com.android.annotations.NonNull;
+import com.android.annotations.Nullable;
+
+import java.net.URL;
+
+public class HtmlBuilder {
+ @NonNull private final StringBuilder mStringBuilder;
+ private String mTableDataExtra;
+
+ public HtmlBuilder(@NonNull StringBuilder stringBuilder) {
+ mStringBuilder = stringBuilder;
+ }
+
+ public HtmlBuilder() {
+ mStringBuilder = new StringBuilder(100);
+ }
+
+ public HtmlBuilder openHtmlBody() {
+ addHtml("<html><body>");
+
+ return this;
+ }
+
+ public HtmlBuilder closeHtmlBody() {
+ addHtml("</body></html>");
+
+ return this;
+ }
+
+ public HtmlBuilder addHtml(@NonNull String html) {
+ mStringBuilder.append(html);
+
+ return this;
+ }
+
+ public HtmlBuilder addNbsp() {
+ mStringBuilder.append(" ");
+
+ return this;
+ }
+
+ public HtmlBuilder addNbsps(int count) {
+ for (int i = 0; i < count; i++) {
+ addNbsp();
+ }
+
+ return this;
+ }
+
+ public HtmlBuilder newline() {
+ mStringBuilder.append("<BR/>\n");
+
+ return this;
+ }
+
+ public HtmlBuilder addLink(@Nullable String textBefore,
+ @NonNull String linkText,
+ @Nullable String textAfter,
+ @NonNull String url) {
+ if (textBefore != null) {
+ add(textBefore);
+ }
+
+ addLink(linkText, url);
+
+ if (textAfter != null) {
+ add(textAfter);
+ }
+
+ return this;
+ }
+
+ public HtmlBuilder addLink(@NonNull String text, @NonNull String url) {
+ int begin = 0;
+ int length = text.length();
+ for (; begin < length; begin++) {
+ char c = text.charAt(begin);
+ if (Character.isWhitespace(c)) {
+ mStringBuilder.append(c);
+ } else {
+ break;
+ }
+ }
+ mStringBuilder.append("<A HREF=\"");
+ mStringBuilder.append(url);
+ mStringBuilder.append("\">");
+
+ XmlUtils.appendXmlTextValue(mStringBuilder, text.trim());
+ mStringBuilder.append("</A>");
+
+ int end = length - 1;
+ for (; end > begin; end--) {
+ char c = text.charAt(begin);
+ if (Character.isWhitespace(c)) {
+ mStringBuilder.append(c);
+ }
+ }
+
+ return this;
+ }
+
+ public HtmlBuilder add(@NonNull String text) {
+ XmlUtils.appendXmlTextValue(mStringBuilder, text);
+
+ return this;
+ }
+
+ @NonNull
+ public String getHtml() {
+ return mStringBuilder.toString();
+ }
+
+ public HtmlBuilder beginBold() {
+ mStringBuilder.append("<B>");
+
+ return this;
+ }
+
+ public HtmlBuilder endBold() {
+ mStringBuilder.append("</B>");
+
+ return this;
+ }
+
+ public HtmlBuilder addBold(String text) {
+ beginBold();
+ add(text);
+ endBold();
+
+ return this;
+ }
+
+ public HtmlBuilder beginDiv() {
+ return beginDiv(null);
+ }
+
+ public HtmlBuilder beginDiv(@Nullable String cssStyle) {
+ mStringBuilder.append("<div");
+ if (cssStyle != null) {
+ mStringBuilder.append(" style=\"");
+ mStringBuilder.append(cssStyle);
+ mStringBuilder.append("\"");
+ }
+ mStringBuilder.append('>');
+ return this;
+ }
+
+ public HtmlBuilder endDiv() {
+ mStringBuilder.append("</div>");
+ return this;
+ }
+
+ public HtmlBuilder addHeading(@NonNull String text, @NonNull String fontColor) {
+ mStringBuilder.append("<font style=\"font-weight:bold; color:").append(fontColor)
+ .append(";\">");
+ add(text);
+ mStringBuilder.append("</font>");
+
+ return this;
+ }
+
+ /**
+ * The JEditorPane HTML renderer creates really ugly bulleted lists; the
+ * size is hardcoded to use a giant heavy bullet. So, use a definition
+ * list instead.
+ */
+ private static final boolean USE_DD_LISTS = true;
+
+ public HtmlBuilder beginList() {
+ if (USE_DD_LISTS) {
+ mStringBuilder.append("<DL>");
+ } else {
+ mStringBuilder.append("<UL>");
+ }
+
+ return this;
+ }
+
+ public HtmlBuilder endList() {
+ if (USE_DD_LISTS) {
+ mStringBuilder.append("\n</DL>");
+ } else {
+ mStringBuilder.append("\n</UL>");
+ }
+
+ return this;
+ }
+
+ public HtmlBuilder listItem() {
+ if (USE_DD_LISTS) {
+ mStringBuilder.append("\n<DD>");
+ mStringBuilder.append("-&NBSP;");
+ } else {
+ mStringBuilder.append("\n<LI>");
+ }
+
+ return this;
+ }
+
+ public HtmlBuilder addImage(URL url, @Nullable String altText) {
+ String link = "";
+ try {
+ link = url.toURI().toURL().toExternalForm();
+ }
+ catch (Throwable t) {
+ // pass
+ }
+ mStringBuilder.append("<img src='");
+ mStringBuilder.append(link);
+
+ if (altText != null) {
+ mStringBuilder.append("' alt=\"");
+ mStringBuilder.append(altText);
+ mStringBuilder.append("\"");
+ }
+ mStringBuilder.append(" />");
+
+ return this;
+ }
+
+ public HtmlBuilder addIcon(@Nullable String src) {
+ if (src != null) {
+ mStringBuilder.append("<img src='");
+ mStringBuilder.append(src);
+ mStringBuilder.append("' width=16 height=16 border=0 />");
+ }
+
+ return this;
+ }
+
+ public HtmlBuilder beginTable(@Nullable String tdExtra) {
+ mStringBuilder.append("<table>");
+ mTableDataExtra = tdExtra;
+ return this;
+ }
+
+ public HtmlBuilder beginTable() {
+ return beginTable(null);
+ }
+
+ public HtmlBuilder endTable() {
+ mStringBuilder.append("</table>");
+ return this;
+ }
+
+ public HtmlBuilder beginTableRow() {
+ mStringBuilder.append("<tr>");
+ return this;
+ }
+
+ public HtmlBuilder endTableRow() {
+ mStringBuilder.append("</tr>");
+ return this;
+ }
+
+ public HtmlBuilder addTableRow(boolean isHeader, String... columns) {
+ if (columns == null || columns.length == 0) {
+ return this;
+ }
+
+ String tag = "t" + (isHeader ? 'h' : 'd');
+
+ beginTableRow();
+ for (String c : columns) {
+ mStringBuilder.append('<');
+ mStringBuilder.append(tag);
+ if (mTableDataExtra != null) {
+ mStringBuilder.append(' ');
+ mStringBuilder.append(mTableDataExtra);
+ }
+ mStringBuilder.append('>');
+
+ mStringBuilder.append(c);
+
+ mStringBuilder.append("</");
+ mStringBuilder.append(tag);
+ mStringBuilder.append('>');
+ }
+ endTableRow();
+
+ return this;
+ }
+
+ public HtmlBuilder addTableRow(String... columns) {
+ return addTableRow(false, columns);
+ }
+
+ @NonNull
+ public StringBuilder getStringBuilder() {
+ return mStringBuilder;
+ }
+}
diff --git a/sdklib/src/main/java/com/android/sdklib/util/SparseArray.java b/common/src/main/java/com/android/utils/SparseArray.java
similarity index 99%
rename from sdklib/src/main/java/com/android/sdklib/util/SparseArray.java
rename to common/src/main/java/com/android/utils/SparseArray.java
index f0693fe..dab5468 100644
--- a/sdklib/src/main/java/com/android/sdklib/util/SparseArray.java
+++ b/common/src/main/java/com/android/utils/SparseArray.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package com.android.sdklib.util;
+package com.android.utils;
/**
diff --git a/sdklib/src/main/java/com/android/sdklib/util/SparseIntArray.java b/common/src/main/java/com/android/utils/SparseIntArray.java
similarity index 99%
rename from sdklib/src/main/java/com/android/sdklib/util/SparseIntArray.java
rename to common/src/main/java/com/android/utils/SparseIntArray.java
index 9573566..cb42d30 100644
--- a/sdklib/src/main/java/com/android/sdklib/util/SparseIntArray.java
+++ b/common/src/main/java/com/android/utils/SparseIntArray.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package com.android.sdklib.util;
+package com.android.utils;
/**
diff --git a/common/src/main/java/com/android/xml/AndroidManifest.java b/common/src/main/java/com/android/xml/AndroidManifest.java
index e2532c7..527a210 100644
--- a/common/src/main/java/com/android/xml/AndroidManifest.java
+++ b/common/src/main/java/com/android/xml/AndroidManifest.java
@@ -89,6 +89,7 @@ public final class AndroidManifest {
public static final String ATTRIBUTE_THEME = "theme";
public static final String ATTRIBUTE_BACKUP_AGENT = "backupAgent";
public static final String ATTRIBUTE_PARENT_ACTIVITY_NAME = "parentActivityName";
+ public static final String ATTRIBUTE_SUPPORTS_RTL = "supportsRtl";
/**
* Returns an {@link IAbstractFile} object representing the manifest for the given project.
@@ -314,6 +315,32 @@ public final class AndroidManifest {
new InputSource(manifestFile.getContents()));
}
+ /**
+ * Returns whether the manifest is set to make the application RTL aware.
+ *
+ * If the give manifest does not contain the supportsRtl attribute then the application
+ * is considered to not be not supporting RTL (there will be no layout mirroring).
+ *
+ * @param manifestFile the manifest to parse.
+ * @return true if the application is supporting RTL.
+ * @throws XPathExpressionException
+ * @throws StreamException If any error happens when reading the manifest.
+ */
+ public static boolean getSupportsRtl(IAbstractFile manifestFile)
+ throws XPathExpressionException, StreamException {
+ XPath xPath = AndroidXPathFactory.newXPath();
+
+ String value = xPath.evaluate(
+ "/" + NODE_MANIFEST +
+ "/" + NODE_APPLICATION +
+ "/@" + AndroidXPathFactory.DEFAULT_NS_PREFIX +
+ ":" + ATTRIBUTE_SUPPORTS_RTL,
+ new InputSource(manifestFile.getContents()));
+
+ // default is not debuggable, which is the same behavior as parseBoolean
+ return Boolean.parseBoolean(value);
+ }
+
/**
* Combines a java package, with a class value from the manifest to make a fully qualified
* class name
diff --git a/ddmlib/.settings/org.eclipse.jdt.core.prefs b/ddmlib/.settings/org.eclipse.jdt.core.prefs
index 9dbff07..ea66196 100644
--- a/ddmlib/.settings/org.eclipse.jdt.core.prefs
+++ b/ddmlib/.settings/org.eclipse.jdt.core.prefs
@@ -48,10 +48,10 @@ org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=ignor
org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning
org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning
org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore
-org.eclipse.jdt.core.compiler.problem.nullAnnotationInferenceConflict=error
-org.eclipse.jdt.core.compiler.problem.nullReference=error
+org.eclipse.jdt.core.compiler.problem.nullAnnotationInferenceConflict=warning
+org.eclipse.jdt.core.compiler.problem.nullReference=warning
org.eclipse.jdt.core.compiler.problem.nullSpecInsufficientInfo=warning
-org.eclipse.jdt.core.compiler.problem.nullSpecViolation=error
+org.eclipse.jdt.core.compiler.problem.nullSpecViolation=warning
org.eclipse.jdt.core.compiler.problem.nullUncheckedConversion=ignore
org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning
org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore
diff --git a/ddmlib/src/main/java/com/android/ddmlib/AdbHelper.java b/ddmlib/src/main/java/com/android/ddmlib/AdbHelper.java
index 8bc42ca..e4529ce 100644
--- a/ddmlib/src/main/java/com/android/ddmlib/AdbHelper.java
+++ b/ddmlib/src/main/java/com/android/ddmlib/AdbHelper.java
@@ -24,6 +24,7 @@ import java.net.InetSocketAddress;
import java.nio.ByteBuffer;
import java.nio.ByteOrder;
import java.nio.channels.SocketChannel;
+import java.util.concurrent.TimeUnit;
/**
* Helper class to handle requests and connections to adb.
@@ -336,6 +337,18 @@ final class AdbHelper {
}
/**
+ * @deprecated Use {@link #executeRemoteCommand(java.net.InetSocketAddress, String, IDevice, IShellOutputReceiver, long, java.util.concurrent.TimeUnit)}.
+ */
+ @Deprecated
+ static void executeRemoteCommand(InetSocketAddress adbSockAddr,
+ String command, IDevice device, IShellOutputReceiver rcvr, int maxTimeToOutputResponse)
+ throws TimeoutException, AdbCommandRejectedException, ShellCommandUnresponsiveException,
+ IOException {
+ executeRemoteCommand(adbSockAddr, command, device, rcvr, maxTimeToOutputResponse,
+ TimeUnit.MILLISECONDS);
+ }
+
+ /**
* Executes a shell command on the device and retrieve the output. The output is
* handed to <var>rcvr</var> as it arrives.
*
@@ -348,6 +361,7 @@ final class AdbHelper {
* between command output, the method will throw
* {@link ShellCommandUnresponsiveException}. A value of 0 means the method will
* wait forever for command output and never throw.
+ * @param maxTimeUnits Units for non-zero {@code maxTimeToOutputResponse} values.
* @throws TimeoutException in case of timeout on the connection when sending the command.
* @throws AdbCommandRejectedException if adb rejects the command
* @throws ShellCommandUnresponsiveException in case the shell command doesn't send any output
@@ -357,9 +371,18 @@ final class AdbHelper {
* @see DdmPreferences#getTimeOut()
*/
static void executeRemoteCommand(InetSocketAddress adbSockAddr,
- String command, IDevice device, IShellOutputReceiver rcvr, int maxTimeToOutputResponse)
- throws TimeoutException, AdbCommandRejectedException, ShellCommandUnresponsiveException,
- IOException {
+ String command, IDevice device, IShellOutputReceiver rcvr, long maxTimeToOutputResponse,
+ TimeUnit maxTimeUnits) throws TimeoutException, AdbCommandRejectedException,
+ ShellCommandUnresponsiveException, IOException {
+
+ long maxTimeToOutputMs = 0;
+ if (maxTimeToOutputResponse > 0) {
+ if (maxTimeUnits == null) {
+ throw new NullPointerException("Time unit must not be null for non-zero max.");
+ }
+ maxTimeToOutputMs = maxTimeUnits.toMillis(maxTimeToOutputResponse);
+ }
+
Log.v("ddms", "execute: running " + command);
SocketChannel adbChan = null;
@@ -383,7 +406,7 @@ final class AdbHelper {
byte[] data = new byte[16384];
ByteBuffer buf = ByteBuffer.wrap(data);
- int timeToResponseCount = 0;
+ long timeToResponseCount = 0;
while (true) {
int count;
@@ -403,8 +426,7 @@ final class AdbHelper {
try {
int wait = WAIT_TIME * 5;
timeToResponseCount += wait;
- if (maxTimeToOutputResponse > 0 &&
- timeToResponseCount > maxTimeToOutputResponse) {
+ if (maxTimeToOutputMs > 0 && timeToResponseCount > maxTimeToOutputMs) {
throw new ShellCommandUnresponsiveException();
}
Thread.sleep(wait);
@@ -578,8 +600,8 @@ final class AdbHelper {
adbChan.configureBlocking(false);
byte[] request = formAdbRequest(String.format(
- "host-serial:%1$s:killforward:%2$s;%3$s", //$NON-NLS-1$
- device.getSerialNumber(), localPortSpec, remotePortSpec));
+ "host-serial:%1$s:killforward:%2$s", //$NON-NLS-1$
+ device.getSerialNumber(), localPortSpec));
write(adbChan, request);
diff --git a/ddmlib/src/main/java/com/android/ddmlib/Client.java b/ddmlib/src/main/java/com/android/ddmlib/Client.java
index 2aac328..82fea87 100644
--- a/ddmlib/src/main/java/com/android/ddmlib/Client.java
+++ b/ddmlib/src/main/java/com/android/ddmlib/Client.java
@@ -17,7 +17,6 @@
package com.android.ddmlib;
import com.android.annotations.NonNull;
-import com.android.ddmlib.ClientData.MethodProfilingStatus;
import com.android.ddmlib.DebugPortManager.IDebugPortProvider;
import com.android.ddmlib.AndroidDebugBridge.IClientChangeListener;
@@ -28,6 +27,7 @@ import java.nio.channels.SelectionKey;
import java.nio.channels.Selector;
import java.nio.channels.SocketChannel;
import java.util.HashMap;
+import java.util.concurrent.TimeUnit;
/**
* This represents a single client, usually a Dalvik VM process.
@@ -98,7 +98,7 @@ public class Client {
* is only used for data generated within Client.
*/
private static final int INITIAL_BUF_SIZE = 2*1024;
- private static final int MAX_BUF_SIZE = 200*1024*1024;
+ private static final int MAX_BUF_SIZE = 800*1024*1024;
private ByteBuffer mReadBuffer;
private static final int WRITE_BUF_SIZE = 256;
@@ -247,25 +247,24 @@ public class Client {
}
}
+ /**
+ * Toggles method profiling state.
+ * @deprecated Use {@link #startMethodTracer()}, {@link #stopMethodTracer()},
+ * {@link #startSamplingProfiler(int, java.util.concurrent.TimeUnit)} or
+ * {@link #stopSamplingProfiler()} instead.
+ */
public void toggleMethodProfiling() {
- boolean canStream = mClientData.hasFeature(ClientData.FEATURE_PROFILING_STREAMING);
try {
- if (mClientData.getMethodProfilingStatus() == MethodProfilingStatus.ON) {
- if (canStream) {
- HandleProfiling.sendMPSE(this);
- } else {
- HandleProfiling.sendMPRE(this);
- }
- } else {
- int bufferSize = DdmPreferences.getProfilerBufferSizeMb() * 1024 * 1024;
- if (canStream) {
- HandleProfiling.sendMPSS(this, bufferSize, 0 /*flags*/);
- } else {
- String file = "/sdcard/" +
- mClientData.getClientDescription().replaceAll("\\:.*", "") +
- DdmConstants.DOT_TRACE;
- HandleProfiling.sendMPRS(this, file, bufferSize, 0 /*flags*/);
- }
+ switch (mClientData.getMethodProfilingStatus()) {
+ case TRACER_ON:
+ stopMethodTracer();
+ break;
+ case SAMPLER_ON:
+ stopSamplingProfiler();
+ break;
+ case OFF:
+ startMethodTracer();
+ break;
}
} catch (IOException e) {
Log.w("ddms", "Toggle method profiling failed");
@@ -273,6 +272,42 @@ public class Client {
}
}
+ private int getProfileBufferSize() {
+ return DdmPreferences.getProfilerBufferSizeMb() * 1024 * 1024;
+ }
+
+ public void startMethodTracer() throws IOException {
+ boolean canStream = mClientData.hasFeature(ClientData.FEATURE_PROFILING_STREAMING);
+ int bufferSize = getProfileBufferSize();
+ if (canStream) {
+ HandleProfiling.sendMPSS(this, bufferSize, 0 /*flags*/);
+ } else {
+ String file = "/sdcard/" +
+ mClientData.getClientDescription().replaceAll("\\:.*", "") +
+ DdmConstants.DOT_TRACE;
+ HandleProfiling.sendMPRS(this, file, bufferSize, 0 /*flags*/);
+ }
+ }
+
+ public void stopMethodTracer() throws IOException {
+ boolean canStream = mClientData.hasFeature(ClientData.FEATURE_PROFILING_STREAMING);
+
+ if (canStream) {
+ HandleProfiling.sendMPSE(this);
+ } else {
+ HandleProfiling.sendMPRE(this);
+ }
+ }
+
+ public void startSamplingProfiler(int samplingInterval, TimeUnit timeUnit) throws IOException {
+ int bufferSize = getProfileBufferSize();
+ HandleProfiling.sendSPSS(this, bufferSize, samplingInterval, timeUnit);
+ }
+
+ public void stopSamplingProfiler() throws IOException {
+ HandleProfiling.sendSPSE(this);
+ }
+
public boolean startOpenGlTracing() {
boolean canTraceOpenGl = mClientData.hasFeature(ClientData.FEATURE_OPENGL_TRACING);
if (!canTraceOpenGl) {
diff --git a/ddmlib/src/main/java/com/android/ddmlib/ClientData.java b/ddmlib/src/main/java/com/android/ddmlib/ClientData.java
index 1e72523..76f5f97 100644
--- a/ddmlib/src/main/java/com/android/ddmlib/ClientData.java
+++ b/ddmlib/src/main/java/com/android/ddmlib/ClientData.java
@@ -92,8 +92,10 @@ public class ClientData {
UNKNOWN,
/** Method profiling status: the {@link Client} is not profiling method calls. */
OFF,
- /** Method profiling status: the {@link Client} is profiling method calls. */
- ON
+ /** Method profiling status: the {@link Client} is tracing method calls. */
+ TRACER_ON,
+ /** Method profiling status: the {@link Client} is being profiled via sampling. */
+ SAMPLER_ON
}
/**
@@ -130,6 +132,12 @@ public class ClientData {
public static final String FEATURE_PROFILING_STREAMING = "method-trace-profiling-streaming"; //$NON-NLS-1$
/**
+ * String for feature enabling sampling profiler.
+ * @see #hasFeature(String)
+ */
+ public static final String FEATURE_SAMPLING_PROFILER = "method-sample-profiling"; //$NON-NLS-1$
+
+ /**
* String for feature indicating support for tracing OpenGL calls.
* @see #hasFeature(String)
*/
diff --git a/ddmlib/src/main/java/com/android/ddmlib/Device.java b/ddmlib/src/main/java/com/android/ddmlib/Device.java
index 55d285d..22c462b 100644
--- a/ddmlib/src/main/java/com/android/ddmlib/Device.java
+++ b/ddmlib/src/main/java/com/android/ddmlib/Device.java
@@ -446,6 +446,15 @@ final class Device implements IDevice {
}
@Override
+ public void executeShellCommand(String command, IShellOutputReceiver receiver,
+ long maxTimeToOutputResponse, TimeUnit maxTimeUnits)
+ throws TimeoutException, AdbCommandRejectedException, ShellCommandUnresponsiveException,
+ IOException {
+ AdbHelper.executeRemoteCommand(AndroidDebugBridge.getSocketAddress(), command, this,
+ receiver, maxTimeToOutputResponse, maxTimeUnits);
+ }
+
+ @Override
public void runEventLogService(LogReceiver receiver)
throws TimeoutException, AdbCommandRejectedException, IOException {
AdbHelper.runEventLogService(AndroidDebugBridge.getSocketAddress(), this, receiver);
diff --git a/ddmlib/src/main/java/com/android/ddmlib/HandleProfiling.java b/ddmlib/src/main/java/com/android/ddmlib/HandleProfiling.java
index 9d01fdf..cdefd2c 100644
--- a/ddmlib/src/main/java/com/android/ddmlib/HandleProfiling.java
+++ b/ddmlib/src/main/java/com/android/ddmlib/HandleProfiling.java
@@ -21,6 +21,7 @@ import com.android.ddmlib.ClientData.MethodProfilingStatus;
import java.io.IOException;
import java.nio.ByteBuffer;
+import java.util.concurrent.TimeUnit;
/**
* Handle heap status updates.
@@ -31,6 +32,8 @@ final class HandleProfiling extends ChunkHandler {
public static final int CHUNK_MPRE = type("MPRE");
public static final int CHUNK_MPSS = type("MPSS");
public static final int CHUNK_MPSE = type("MPSE");
+ public static final int CHUNK_SPSS = type("SPSS");
+ public static final int CHUNK_SPSE = type("SPSE");
public static final int CHUNK_MPRQ = type("MPRQ");
public static final int CHUNK_FAIL = type("FAIL");
@@ -194,6 +197,35 @@ final class HandleProfiling extends ChunkHandler {
}
/**
+ * Send a SPSS (Sampling Profiling Streaming Start) request to the client.
+ *
+ * @param bufferSize is the desired buffer size in bytes (8MB is good)
+ * @param samplingInterval sampling interval
+ * @param samplingIntervalTimeUnits units for sampling interval
+ */
+ public static void sendSPSS(Client client, int bufferSize, int samplingInterval,
+ TimeUnit samplingIntervalTimeUnits) throws IOException {
+ int interval = (int) samplingIntervalTimeUnits.toMicros(samplingInterval);
+
+ ByteBuffer rawBuf = allocBuffer(3*4);
+ JdwpPacket packet = new JdwpPacket(rawBuf);
+ ByteBuffer buf = getChunkDataBuf(rawBuf);
+
+ buf.putInt(bufferSize);
+ buf.putInt(0); // flags
+ buf.putInt(interval);
+
+ finishChunkPacket(packet, CHUNK_SPSS, buf.position());
+ Log.d("ddm-prof", "Sending " + name(CHUNK_SPSS)
+ + "', size=" + bufferSize + ", flags=0, samplingInterval=" + interval);
+ client.sendAndConsume(packet, mInst);
+
+ // send a status query. this ensure that the status is properly updated if for some
+ // reason starting the tracing failed.
+ sendMPRQ(client);
+ }
+
+ /**
* Send a MPSE (Method Profiling Streaming End) request to the client.
*/
public static void sendMPSE(Client client) throws IOException {
@@ -209,6 +241,21 @@ final class HandleProfiling extends ChunkHandler {
}
/**
+ * Send a SPSE (Sampling Profiling Streaming End) request to the client.
+ */
+ public static void sendSPSE(Client client) throws IOException {
+ ByteBuffer rawBuf = allocBuffer(0);
+ JdwpPacket packet = new JdwpPacket(rawBuf);
+ ByteBuffer buf = getChunkDataBuf(rawBuf);
+
+ // no data
+
+ finishChunkPacket(packet, CHUNK_SPSE, buf.position());
+ Log.d("ddm-prof", "Sending " + name(CHUNK_SPSE));
+ client.sendAndConsume(packet, mInst);
+ }
+
+ /**
* Handle incoming profiling data. The MPSE packet includes the
* complete .trace file.
*/
@@ -253,9 +300,12 @@ final class HandleProfiling extends ChunkHandler {
if (result == 0) {
client.getClientData().setMethodProfilingStatus(MethodProfilingStatus.OFF);
Log.d("ddm-prof", "Method profiling is not running");
- } else {
- client.getClientData().setMethodProfilingStatus(MethodProfilingStatus.ON);
- Log.d("ddm-prof", "Method profiling is running");
+ } else if (result == 1) {
+ client.getClientData().setMethodProfilingStatus(MethodProfilingStatus.TRACER_ON);
+ Log.d("ddm-prof", "Method tracing is active");
+ } else if (result == 2) {
+ client.getClientData().setMethodProfilingStatus(MethodProfilingStatus.SAMPLER_ON);
+ Log.d("ddm-prof", "Sampler based profiling is active");
}
client.update(Client.CHANGE_METHOD_PROFILING_STATUS);
}
diff --git a/ddmlib/src/main/java/com/android/ddmlib/IDevice.java b/ddmlib/src/main/java/com/android/ddmlib/IDevice.java
index a9ebaad..7b70acb 100644
--- a/ddmlib/src/main/java/com/android/ddmlib/IDevice.java
+++ b/ddmlib/src/main/java/com/android/ddmlib/IDevice.java
@@ -24,7 +24,7 @@ import java.util.Map;
/**
* A Device. It can be a physical device or an emulator.
*/
-public interface IDevice {
+public interface IDevice extends IShellEnabledDevice {
public static final String PROP_BUILD_VERSION = "ro.build.version.release";
public static final String PROP_BUILD_API_LEVEL = "ro.build.version.sdk";
@@ -117,12 +117,6 @@ public interface IDevice {
public String getAvdName();
/**
- * Returns a (humanized) name for this device. Typically this is the AVD name for AVD's, and
- * a combination of the manufacturer name, model name & serial number for devices.
- */
- public String getName();
-
- /**
* Returns the state of the device.
*/
public DeviceState getState();
@@ -268,6 +262,15 @@ public interface IDevice {
IOException;
/**
+ * @deprecated Use {@link #executeShellCommand(String, IShellOutputReceiver, long, java.util.concurrent.TimeUnit)}.
+ */
+ @Deprecated
+ public void executeShellCommand(String command, IShellOutputReceiver receiver,
+ int maxTimeToOutputResponse)
+ throws TimeoutException, AdbCommandRejectedException, ShellCommandUnresponsiveException,
+ IOException;
+
+ /**
* Executes a shell command on the device, and sends the result to a <var>receiver</var>
* <p/>This is similar to calling
* <code>executeShellCommand(command, receiver, DdmPreferences.getTimeOut())</code>.
@@ -289,38 +292,6 @@ public interface IDevice {
IOException;
/**
- * Executes a shell command on the device, and sends the result to a <var>receiver</var>.
- * <p/><var>maxTimeToOutputResponse</var> is used as a maximum waiting time when expecting the
- * command output from the device.<br>
- * At any time, if the shell command does not output anything for a period longer than
- * <var>maxTimeToOutputResponse</var>, then the method will throw
- * {@link ShellCommandUnresponsiveException}.
- * <p/>For commands like log output, a <var>maxTimeToOutputResponse</var> value of 0, meaning
- * that the method will never throw and will block until the receiver's
- * {@link IShellOutputReceiver#isCancelled()} returns <code>true</code>, should be
- * used.
- *
- * @param command the shell command to execute
- * @param receiver the {@link IShellOutputReceiver} that will receives the output of the shell
- * command
- * @param maxTimeToOutputResponse the maximum amount of time during which the command is allowed
- * to not output any response. A value of 0 means the method will wait forever
- * (until the <var>receiver</var> cancels the execution) for command output and
- * never throw.
- * @throws TimeoutException in case of timeout on the connection when sending the command.
- * @throws AdbCommandRejectedException if adb rejects the command.
- * @throws ShellCommandUnresponsiveException in case the shell command doesn't send any output
- * for a period longer than <var>maxTimeToOutputResponse</var>.
- * @throws IOException in case of I/O error on the connection.
- *
- * @see DdmPreferences#getTimeOut()
- */
- public void executeShellCommand(String command, IShellOutputReceiver receiver,
- int maxTimeToOutputResponse)
- throws TimeoutException, AdbCommandRejectedException, ShellCommandUnresponsiveException,
- IOException;
-
- /**
* Runs the event log service and outputs the event log to the {@link LogReceiver}.
* <p/>This call is blocking until {@link LogReceiver#isCancelled()} returns true.
* @param receiver the receiver to receive the event log entries.
diff --git a/ddmlib/src/main/java/com/android/ddmlib/IShellEnabledDevice.java b/ddmlib/src/main/java/com/android/ddmlib/IShellEnabledDevice.java
new file mode 100644
index 0000000..89dcf09
--- /dev/null
+++ b/ddmlib/src/main/java/com/android/ddmlib/IShellEnabledDevice.java
@@ -0,0 +1,65 @@
+/*
+ * Copyright (C) 2013 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.ddmlib;
+
+import java.io.IOException;
+import java.util.concurrent.TimeUnit;
+
+/**
+ * An abstract device that can receive shell commands.
+ */
+public interface IShellEnabledDevice {
+
+ /**
+ * Returns a (humanized) name for this device. Typically this is the AVD name for AVD's, and
+ * a combination of the manufacturer name, model name & serial number for devices.
+ */
+ public String getName();
+
+ /**
+ * Executes a shell command on the device, and sends the result to a <var>receiver</var>.
+ * <p/><var>maxTimeToOutputResponse</var> is used as a maximum waiting time when expecting the
+ * command output from the device.<br>
+ * At any time, if the shell command does not output anything for a period longer than
+ * <var>maxTimeToOutputResponse</var>, then the method will throw
+ * {@link ShellCommandUnresponsiveException}.
+ * <p/>For commands like log output, a <var>maxTimeToOutputResponse</var> value of 0, meaning
+ * that the method will never throw and will block until the receiver's
+ * {@link IShellOutputReceiver#isCancelled()} returns <code>true</code>, should be
+ * used.
+ *
+ * @param command the shell command to execute
+ * @param receiver the {@link IShellOutputReceiver} that will receives the output of the shell
+ * command
+ * @param maxTimeToOutputResponse the maximum amount of time during which the command is allowed
+ * to not output any response. A value of 0 means the method will wait forever
+ * (until the <var>receiver</var> cancels the execution) for command output and
+ * never throw.
+ * @param maxTimeUnits Units for non-zero {@code maxTimeToOutputResponse} values.
+ * @throws TimeoutException in case of timeout on the connection when sending the command.
+ * @throws AdbCommandRejectedException if adb rejects the command.
+ * @throws ShellCommandUnresponsiveException in case the shell command doesn't send any output
+ * for a period longer than <var>maxTimeToOutputResponse</var>.
+ * @throws IOException in case of I/O error on the connection.
+ *
+ * @see DdmPreferences#getTimeOut()
+ */
+ public void executeShellCommand(String command, IShellOutputReceiver receiver,
+ long maxTimeToOutputResponse, TimeUnit maxTimeUnits)
+ throws TimeoutException, AdbCommandRejectedException, ShellCommandUnresponsiveException,
+ IOException;
+}
diff --git a/ddmlib/src/main/java/com/android/ddmlib/NativeAllocationInfo.java b/ddmlib/src/main/java/com/android/ddmlib/NativeAllocationInfo.java
index baefa81..65c14ba 100644
--- a/ddmlib/src/main/java/com/android/ddmlib/NativeAllocationInfo.java
+++ b/ddmlib/src/main/java/com/android/ddmlib/NativeAllocationInfo.java
@@ -28,7 +28,7 @@ import java.util.regex.Pattern;
* <p/>Note: the ddmlib does not resolve the stack trace automatically. While this class provides
* storage for resolved stack trace, this is merely for convenience.
*/
-public final class NativeAllocationInfo {
+public class NativeAllocationInfo {
/* Keywords used as delimiters in the string representation of a NativeAllocationInfo */
public static final String END_STACKTRACE_KW = "EndStacktrace";
public static final String BEGIN_STACKTRACE_KW = "BeginStacktrace:";
@@ -59,8 +59,7 @@ public final class NativeAllocationInfo {
private final boolean mIsZygoteChild;
- private final int mAllocations;
-
+ private int mAllocations;
private final ArrayList<Long> mStackCallAddresses = new ArrayList<Long>();
private ArrayList<NativeStackCallInfo> mResolvedStackCall = null;
@@ -87,7 +86,7 @@ public final class NativeAllocationInfo {
}
/**
- * Returns the total size of this allocation.
+ * Returns the size of this allocation.
*/
public int getSize() {
return mSize;
@@ -169,26 +168,34 @@ public final class NativeAllocationInfo {
return true;
if (obj instanceof NativeAllocationInfo) {
NativeAllocationInfo mi = (NativeAllocationInfo)obj;
- // quick compare of size, alloc, and stackcall size
- if (mSize != mi.mSize || mAllocations != mi.mAllocations ||
- mStackCallAddresses.size() != mi.mStackCallAddresses.size()) {
+ // compare of size and alloc
+ if (mSize != mi.mSize || mAllocations != mi.mAllocations) {
return false;
}
- // compare the stack addresses
- int count = mStackCallAddresses.size();
- for (int i = 0 ; i < count ; i++) {
- long a = mStackCallAddresses.get(i);
- long b = mi.mStackCallAddresses.get(i);
- if (a != b) {
- return false;
- }
- }
- return true;
+ // compare stacks
+ return stackEquals(mi);
}
return false;
}
+ public boolean stackEquals(NativeAllocationInfo mi) {
+ if (mStackCallAddresses.size() != mi.mStackCallAddresses.size()) {
+ return false;
+ }
+
+ int count = mStackCallAddresses.size();
+ for (int i = 0 ; i < count ; i++) {
+ long a = mStackCallAddresses.get(i);
+ long b = mi.mStackCallAddresses.get(i);
+ if (a != b) {
+ return false;
+ }
+ }
+
+ return true;
+ }
+
@Override
public int hashCode() {
diff --git a/ddmlib/src/main/java/com/android/ddmlib/TimeoutException.java b/ddmlib/src/main/java/com/android/ddmlib/TimeoutException.java
index 78f5db7..cc083c1 100644
--- a/ddmlib/src/main/java/com/android/ddmlib/TimeoutException.java
+++ b/ddmlib/src/main/java/com/android/ddmlib/TimeoutException.java
@@ -23,4 +23,19 @@ package com.android.ddmlib;
*/
public class TimeoutException extends Exception {
private static final long serialVersionUID = 1L;
+
+ public TimeoutException() {
+ }
+
+ public TimeoutException(String s) {
+ super(s);
+ }
+
+ public TimeoutException(String s, Throwable throwable) {
+ super(s, throwable);
+ }
+
+ public TimeoutException(Throwable throwable) {
+ super(throwable);
+ }
}
diff --git a/ddmlib/src/main/java/com/android/ddmlib/testrunner/IRemoteAndroidTestRunner.java b/ddmlib/src/main/java/com/android/ddmlib/testrunner/IRemoteAndroidTestRunner.java
index 7d3d6bf..7d2b11f 100644
--- a/ddmlib/src/main/java/com/android/ddmlib/testrunner/IRemoteAndroidTestRunner.java
+++ b/ddmlib/src/main/java/com/android/ddmlib/testrunner/IRemoteAndroidTestRunner.java
@@ -23,6 +23,7 @@ import com.android.ddmlib.TimeoutException;
import java.io.IOException;
import java.util.Collection;
+import java.util.concurrent.TimeUnit;
/**
* Interface for running a Android test command remotely and reporting result to a listener.
@@ -173,6 +174,12 @@ public interface IRemoteAndroidTestRunner {
public void setCoverage(boolean coverage);
/**
+ * @deprecated Use {@link #setMaxTimeToOutputResponse(long, java.util.concurrent.TimeUnit)}.
+ */
+ @Deprecated
+ public void setMaxtimeToOutputResponse(int maxTimeToOutputResponse);
+
+ /**
* Sets the maximum time allowed between output of the shell command running the tests on
* the devices.
* <p/>
@@ -181,9 +188,15 @@ public interface IRemoteAndroidTestRunner {
* <p/>
* By default no timeout will be specified.
*
+ * @param maxTimeToOutputResponse the maximum amount of time during which the command is allowed
+ * to not output any response. A value of 0 means the method will wait forever
+ * (until the <var>receiver</var> cancels the execution) for command output and
+ * never throw.
+ * @param maxTimeUnits Units for non-zero {@code maxTimeToOutputResponse} values.
+ *
* @see IDevice#executeShellCommand(String, com.android.ddmlib.IShellOutputReceiver, int)
*/
- public void setMaxtimeToOutputResponse(int maxTimeToOutputResponse);
+ public void setMaxTimeToOutputResponse(long maxTimeToOutputResponse, TimeUnit maxTimeUnits);
/**
* Set a custom run name to be reported to the {@link ITestRunListener} on {@link #run}
diff --git a/ddmlib/src/main/java/com/android/ddmlib/testrunner/RemoteAndroidTestRunner.java b/ddmlib/src/main/java/com/android/ddmlib/testrunner/RemoteAndroidTestRunner.java
index 9897fcd..19594fc 100644
--- a/ddmlib/src/main/java/com/android/ddmlib/testrunner/RemoteAndroidTestRunner.java
+++ b/ddmlib/src/main/java/com/android/ddmlib/testrunner/RemoteAndroidTestRunner.java
@@ -18,7 +18,7 @@ package com.android.ddmlib.testrunner;
import com.android.ddmlib.AdbCommandRejectedException;
-import com.android.ddmlib.IDevice;
+import com.android.ddmlib.IShellEnabledDevice;
import com.android.ddmlib.Log;
import com.android.ddmlib.ShellCommandUnresponsiveException;
import com.android.ddmlib.TimeoutException;
@@ -29,6 +29,7 @@ import java.util.Collection;
import java.util.Hashtable;
import java.util.Map;
import java.util.Map.Entry;
+import java.util.concurrent.TimeUnit;
/**
* Runs a Android test command remotely and reports results.
@@ -37,9 +38,10 @@ public class RemoteAndroidTestRunner implements IRemoteAndroidTestRunner {
private final String mPackageName;
private final String mRunnerName;
- private IDevice mRemoteDevice;
+ private IShellEnabledDevice mRemoteDevice;
// default to no timeout
- private int mMaxTimeToOutputResponse = 0;
+ private long mMaxTimeToOutputResponse = 0;
+ private TimeUnit mMaxTimeUnits = TimeUnit.MILLISECONDS;
private String mRunName = null;
/** map of name-value instrumentation argument pairs */
@@ -71,7 +73,7 @@ public class RemoteAndroidTestRunner implements IRemoteAndroidTestRunner {
*/
public RemoteAndroidTestRunner(String packageName,
String runnerName,
- IDevice remoteDevice) {
+ IShellEnabledDevice remoteDevice) {
mPackageName = packageName;
mRunnerName = runnerName;
@@ -86,7 +88,7 @@ public class RemoteAndroidTestRunner implements IRemoteAndroidTestRunner {
* @param remoteDevice the Android device to execute tests on
*/
public RemoteAndroidTestRunner(String packageName,
- IDevice remoteDevice) {
+ IShellEnabledDevice remoteDevice) {
this(packageName, null, remoteDevice);
}
@@ -181,7 +183,13 @@ public class RemoteAndroidTestRunner implements IRemoteAndroidTestRunner {
@Override
public void setMaxtimeToOutputResponse(int maxTimeToOutputResponse) {
+ setMaxTimeToOutputResponse(maxTimeToOutputResponse, TimeUnit.MILLISECONDS);
+ }
+
+ @Override
+ public void setMaxTimeToOutputResponse(long maxTimeToOutputResponse, TimeUnit maxTimeUnits) {
mMaxTimeToOutputResponse = maxTimeToOutputResponse;
+ mMaxTimeUnits = maxTimeUnits;
}
@Override
@@ -203,22 +211,23 @@ public class RemoteAndroidTestRunner implements IRemoteAndroidTestRunner {
final String runCaseCommandStr = String.format("am instrument -w -r %1$s %2$s",
getArgsCommand(), getRunnerPath());
Log.i(LOG_TAG, String.format("Running %1$s on %2$s", runCaseCommandStr,
- mRemoteDevice.getSerialNumber()));
+ mRemoteDevice.getName()));
String runName = mRunName == null ? mPackageName : mRunName;
mParser = new InstrumentationResultParser(runName, listeners);
try {
- mRemoteDevice.executeShellCommand(runCaseCommandStr, mParser, mMaxTimeToOutputResponse);
+ mRemoteDevice.executeShellCommand(runCaseCommandStr, mParser, mMaxTimeToOutputResponse,
+ mMaxTimeUnits);
} catch (IOException e) {
Log.w(LOG_TAG, String.format("IOException %1$s when running tests %2$s on %3$s",
- e.toString(), getPackageName(), mRemoteDevice.getSerialNumber()));
+ e.toString(), getPackageName(), mRemoteDevice.getName()));
// rely on parser to communicate results to listeners
mParser.handleTestRunFailed(e.toString());
throw e;
} catch (ShellCommandUnresponsiveException e) {
Log.w(LOG_TAG, String.format(
"ShellCommandUnresponsiveException %1$s when running tests %2$s on %3$s",
- e.toString(), getPackageName(), mRemoteDevice.getSerialNumber()));
+ e.toString(), getPackageName(), mRemoteDevice.getName()));
mParser.handleTestRunFailed(String.format(
"Failed to receive adb shell test output within %1$d ms. " +
"Test may have timed out, or adb connection to device became unresponsive",
@@ -227,13 +236,13 @@ public class RemoteAndroidTestRunner implements IRemoteAndroidTestRunner {
} catch (TimeoutException e) {
Log.w(LOG_TAG, String.format(
"TimeoutException when running tests %1$s on %2$s", getPackageName(),
- mRemoteDevice.getSerialNumber()));
+ mRemoteDevice.getName()));
mParser.handleTestRunFailed(e.toString());
throw e;
} catch (AdbCommandRejectedException e) {
Log.w(LOG_TAG, String.format(
"AdbCommandRejectedException %1$s when running tests %2$s on %3$s",
- e.toString(), getPackageName(), mRemoteDevice.getSerialNumber()));
+ e.toString(), getPackageName(), mRemoteDevice.getName()));
mParser.handleTestRunFailed(e.toString());
throw e;
}
diff --git a/ddms/app/.settings/org.eclipse.jdt.core.prefs b/ddms/app/.settings/org.eclipse.jdt.core.prefs
index 9dbff07..ea66196 100644
--- a/ddms/app/.settings/org.eclipse.jdt.core.prefs
+++ b/ddms/app/.settings/org.eclipse.jdt.core.prefs
@@ -48,10 +48,10 @@ org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=ignor
org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning
org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning
org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore
-org.eclipse.jdt.core.compiler.problem.nullAnnotationInferenceConflict=error
-org.eclipse.jdt.core.compiler.problem.nullReference=error
+org.eclipse.jdt.core.compiler.problem.nullAnnotationInferenceConflict=warning
+org.eclipse.jdt.core.compiler.problem.nullReference=warning
org.eclipse.jdt.core.compiler.problem.nullSpecInsufficientInfo=warning
-org.eclipse.jdt.core.compiler.problem.nullSpecViolation=error
+org.eclipse.jdt.core.compiler.problem.nullSpecViolation=warning
org.eclipse.jdt.core.compiler.problem.nullUncheckedConversion=ignore
org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning
org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore
diff --git a/ddms/app/ddms.iml b/ddms/app/ddms.iml
new file mode 100644
index 0000000..2927ff1
--- /dev/null
+++ b/ddms/app/ddms.iml
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<module type="JAVA_MODULE" version="4">
+ <component name="NewModuleRootManager" inherit-compiler-output="true">
+ <exclude-output />
+ <content url="file://$MODULE_DIR$">
+ <sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
+ <sourceFolder url="file://$MODULE_DIR$/src/main/resources" isTestSource="false" />
+ </content>
+ <orderEntry type="inheritedJdk" />
+ <orderEntry type="sourceFolder" forTests="false" />
+ <orderEntry type="module" module-name="common" />
+ <orderEntry type="module" module-name="ddmlib" />
+ <orderEntry type="module" module-name="ddmuilib" />
+ <orderEntry type="module" module-name="sdkstats" />
+ <orderEntry type="module" module-name="swtmenubar" />
+ </component>
+</module>
+
diff --git a/ddms/app/etc/ddms.bat b/ddms/app/etc/ddms.bat
index d710ea6..1f2e154 100755
--- a/ddms/app/etc/ddms.bat
+++ b/ddms/app/etc/ddms.bat
@@ -33,13 +33,13 @@ call lib\find_java.bat
if not defined java_exe goto :EOF
set jarfile=ddms.jar
-set frameworkdir=
+set frameworkdir=.
-if exist %frameworkdir%%jarfile% goto JarFileOk
- set frameworkdir=lib\
+if exist %frameworkdir%\%jarfile% goto JarFileOk
+ set frameworkdir=lib
-if exist %frameworkdir%%jarfile% goto JarFileOk
- set frameworkdir=..\framework\
+if exist %frameworkdir%\%jarfile% goto JarFileOk
+ set frameworkdir=..\framework
:JarFileOk
@@ -48,7 +48,7 @@ if debug NEQ "%1" goto NoDebug
shift 1
:NoDebug
-set jarpath=%frameworkdir%%jarfile%;%frameworkdir%swtmenubar.jar
+set jarpath=%frameworkdir%\%jarfile%;%frameworkdir%\swtmenubar.jar
if not defined ANDROID_SWT goto QueryArch
set swt_path=%ANDROID_SWT%
@@ -56,11 +56,11 @@ if not defined ANDROID_SWT goto QueryArch
:QueryArch
- for /f %%a in ('%java_exe% -jar %frameworkdir%archquery.jar') do set swt_path=%frameworkdir%%%a
+ for /f "delims=" %%a in ('"%java_exe%" -jar %frameworkdir%\archquery.jar') do set swt_path=%frameworkdir%\%%a
:SwtDone
-if exist %swt_path% goto SetPath
+if exist "%swt_path%" goto SetPath
echo SWT folder '%swt_path%' does not exist.
echo Please set ANDROID_SWT to point to the folder containing swt.jar for your platform.
exit /B
@@ -70,5 +70,5 @@ set javaextdirs=%swt_path%;%frameworkdir%
echo The standalone version of DDMS is deprecated.
echo Please use Android Device Monitor (monitor.bat) instead.
-call %java_exe% %java_debug% -Dcom.android.ddms.bindir=%prog_dir% -classpath "%jarpath%;%swt_path%\swt.jar" com.android.ddms.Main %*
+call "%java_exe%" %java_debug% "-Dcom.android.ddms.bindir=%prog_dir%" -classpath "%jarpath%;%swt_path%\swt.jar" com.android.ddms.Main %*
diff --git a/ddms/app/src/main/java/com/android/ddms/UIThread.java b/ddms/app/src/main/java/com/android/ddms/UIThread.java
index 1310429..7680f08 100644
--- a/ddms/app/src/main/java/com/android/ddms/UIThread.java
+++ b/ddms/app/src/main/java/com/android/ddms/UIThread.java
@@ -1719,7 +1719,8 @@ public class UIThread implements IUiSelectionListener, IClientChangeListener {
if (data.hasFeature(ClientData.FEATURE_PROFILING)) {
mTBProfiling.setEnabled(true);
- if (data.getMethodProfilingStatus() == MethodProfilingStatus.ON) {
+ if (data.getMethodProfilingStatus() == MethodProfilingStatus.TRACER_ON
+ || data.getMethodProfilingStatus() == MethodProfilingStatus.SAMPLER_ON) {
mTBProfiling.setToolTipText("Stop Method Profiling");
mTBProfiling.setImage(mTracingStopImage);
} else {
@@ -1729,7 +1730,7 @@ public class UIThread implements IUiSelectionListener, IClientChangeListener {
} else {
mTBProfiling.setEnabled(false);
mTBProfiling.setImage(mTracingStartImage);
- mTBProfiling.setToolTipText("Start Method Profiling (not supported by this VM)");
+ mTBProfiling.setToolTipText("Method Profiling (not supported by this VM)");
}
} else {
// list is empty, disable these
diff --git a/ddms/ddmuilib/.settings/org.eclipse.jdt.core.prefs b/ddms/ddmuilib/.settings/org.eclipse.jdt.core.prefs
index 9dbff07..ea66196 100644
--- a/ddms/ddmuilib/.settings/org.eclipse.jdt.core.prefs
+++ b/ddms/ddmuilib/.settings/org.eclipse.jdt.core.prefs
@@ -48,10 +48,10 @@ org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=ignor
org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning
org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning
org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore
-org.eclipse.jdt.core.compiler.problem.nullAnnotationInferenceConflict=error
-org.eclipse.jdt.core.compiler.problem.nullReference=error
+org.eclipse.jdt.core.compiler.problem.nullAnnotationInferenceConflict=warning
+org.eclipse.jdt.core.compiler.problem.nullReference=warning
org.eclipse.jdt.core.compiler.problem.nullSpecInsufficientInfo=warning
-org.eclipse.jdt.core.compiler.problem.nullSpecViolation=error
+org.eclipse.jdt.core.compiler.problem.nullSpecViolation=warning
org.eclipse.jdt.core.compiler.problem.nullUncheckedConversion=ignore
org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning
org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore
diff --git a/ddms/ddmuilib/ddmuilib.iml b/ddms/ddmuilib/ddmuilib.iml
new file mode 100644
index 0000000..cb79ec6
--- /dev/null
+++ b/ddms/ddmuilib/ddmuilib.iml
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<module type="JAVA_MODULE" version="4">
+ <component name="NewModuleRootManager" inherit-compiler-output="true">
+ <exclude-output />
+ <content url="file://$MODULE_DIR$">
+ <sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
+ <sourceFolder url="file://$MODULE_DIR$/src/test/java" isTestSource="true" />
+ </content>
+ <orderEntry type="inheritedJdk" />
+ <orderEntry type="sourceFolder" forTests="false" />
+ <orderEntry type="module" module-name="ddmlib" />
+ <orderEntry type="library" exported="" name="swt" level="project" />
+ <orderEntry type="library" exported="" name="org-eclipse-core-commands-3.6.0" level="project" />
+ <orderEntry type="library" exported="" name="org-eclipse-equinox-common-3.6.0" level="project" />
+ <orderEntry type="library" exported="" name="org-eclipse-jface-3.6.2" level="project" />
+ <orderEntry type="library" name="jcommon-1.0.12" level="project" />
+ <orderEntry type="library" name="jfreechart-1.0.9" level="project" />
+ <orderEntry type="library" name="jfreechart-swt-1.0.9" level="project" />
+ <orderEntry type="library" scope="TEST" name="JUnit3" level="project" />
+ </component>
+</module>
+
diff --git a/ddms/ddmuilib/src/main/java/com/android/ddmuilib/DevicePanel.java b/ddms/ddmuilib/src/main/java/com/android/ddmuilib/DevicePanel.java
index a24b8a0..fb97062 100644
--- a/ddms/ddmuilib/src/main/java/com/android/ddmuilib/DevicePanel.java
+++ b/ddms/ddmuilib/src/main/java/com/android/ddmuilib/DevicePanel.java
@@ -16,6 +16,7 @@
package com.android.ddmuilib;
+import com.android.annotations.NonNull;
import com.android.ddmlib.AndroidDebugBridge;
import com.android.ddmlib.AndroidDebugBridge.IClientChangeListener;
import com.android.ddmlib.AndroidDebugBridge.IDebugBridgeChangeListener;
@@ -26,7 +27,10 @@ import com.android.ddmlib.ClientData.DebuggerStatus;
import com.android.ddmlib.DdmPreferences;
import com.android.ddmlib.IDevice;
import com.android.ddmlib.IDevice.DeviceState;
+import com.android.ddmuilib.vmtrace.VmTraceOptionsDialog;
+import com.google.common.base.Throwables;
+import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.jface.preference.IPreferenceStore;
import org.eclipse.jface.viewers.ILabelProviderListener;
import org.eclipse.jface.viewers.ITableLabelProvider;
@@ -35,6 +39,7 @@ import org.eclipse.jface.viewers.TreePath;
import org.eclipse.jface.viewers.TreeSelection;
import org.eclipse.jface.viewers.TreeViewer;
import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.jface.window.Window;
import org.eclipse.swt.SWT;
import org.eclipse.swt.SWTException;
import org.eclipse.swt.events.SelectionAdapter;
@@ -48,8 +53,10 @@ import org.eclipse.swt.widgets.Tree;
import org.eclipse.swt.widgets.TreeColumn;
import org.eclipse.swt.widgets.TreeItem;
+import java.io.IOException;
import java.util.ArrayList;
import java.util.Locale;
+import java.util.concurrent.TimeUnit;
/**
* A display of both the devices and their clients.
@@ -310,7 +317,6 @@ public final class DevicePanel extends Panel implements IDebugBridgeChangeListen
/**
* Creates the {@link DevicePanel} object.
- * @param loader
* @param advancedPortSupport if true the device panel will add support for selected client port
* and display the ports in the ui.
*/
@@ -447,8 +453,49 @@ public final class DevicePanel extends Panel implements IDebugBridgeChangeListen
}
public void toggleMethodProfiling() {
- if (mCurrentClient != null) {
- mCurrentClient.toggleMethodProfiling();
+ if (mCurrentClient == null) {
+ return;
+ }
+
+ try {
+ toggleMethodProfiling(mCurrentClient);
+ } catch (IOException e) {
+ MessageDialog.openError(mTree.getShell(), "Method Profiling",
+ "Unexpected I/O error while starting/stopping profiling: "
+ + Throwables.getRootCause(e).getMessage());
+ }
+ }
+
+ private void toggleMethodProfiling(@NonNull Client client) throws IOException {
+ ClientData cd = mCurrentClient.getClientData();
+ if (cd.getMethodProfilingStatus() == ClientData.MethodProfilingStatus.TRACER_ON) {
+ mCurrentClient.stopMethodTracer();
+ } else if (cd.getMethodProfilingStatus() == ClientData.MethodProfilingStatus.SAMPLER_ON) {
+ mCurrentClient.stopSamplingProfiler();
+ } else {
+ boolean supportsSampling = cd.hasFeature(ClientData.FEATURE_SAMPLING_PROFILER);
+
+ // default to tracing
+ boolean shouldUseTracing = true;
+ int samplingIntervalMicros = 1;
+
+ // if client supports sampling, then ask the user to choose the method
+ if (supportsSampling) {
+ VmTraceOptionsDialog dialog = new VmTraceOptionsDialog(mTree.getShell());
+ if (dialog.open() == Window.CANCEL) {
+ return;
+ }
+ shouldUseTracing = dialog.shouldUseTracing();
+ if (!shouldUseTracing) {
+ samplingIntervalMicros = dialog.getSamplingIntervalMicros();
+ }
+ }
+
+ if (shouldUseTracing) {
+ mCurrentClient.startMethodTracer();
+ } else {
+ mCurrentClient.startSamplingProfiler(samplingIntervalMicros, TimeUnit.MICROSECONDS);
+ }
}
}
@@ -469,8 +516,6 @@ public final class DevicePanel extends Panel implements IDebugBridgeChangeListen
* <p/>
* This is sent from a non UI thread.
* @param bridge the new {@link AndroidDebugBridge} object.
- *
- * @see IDebugBridgeChangeListener#serverChanged(AndroidDebugBridge)
*/
@Override
public void bridgeChanged(final AndroidDebugBridge bridge) {
@@ -563,7 +608,7 @@ public final class DevicePanel extends Panel implements IDebugBridgeChangeListen
* @param device the device that was updated.
* @param changeMask the mask indicating what changed.
*
- * @see IDeviceChangeListener#deviceChanged(IDevice)
+ * @see IDeviceChangeListener#deviceChanged(IDevice,int)
*/
@Override
public void deviceChanged(final IDevice device, int changeMask) {
diff --git a/ddms/ddmuilib/src/main/java/com/android/ddmuilib/SysinfoPanel.java b/ddms/ddmuilib/src/main/java/com/android/ddmuilib/SysinfoPanel.java
index 8ba2171..3e68f37 100644
--- a/ddms/ddmuilib/src/main/java/com/android/ddmuilib/SysinfoPanel.java
+++ b/ddms/ddmuilib/src/main/java/com/android/ddmuilib/SysinfoPanel.java
@@ -16,6 +16,7 @@
package com.android.ddmuilib;
+import com.android.annotations.concurrency.GuardedBy;
import com.android.ddmlib.AdbCommandRejectedException;
import com.android.ddmlib.Client;
import com.android.ddmlib.ClientData;
@@ -52,19 +53,23 @@ import org.jfree.experimental.chart.swt.ChartComposite;
import java.io.BufferedReader;
import java.io.File;
+import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.FileReader;
import java.io.IOException;
+import java.io.OutputStream;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
+import java.util.concurrent.atomic.AtomicBoolean;
+import java.util.concurrent.atomic.AtomicReference;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
/**
* Displays system information graphs obtained from a bugreport file or device.
*/
-public class SysinfoPanel extends TablePanel implements IShellOutputReceiver {
+public class SysinfoPanel extends TablePanel {
// UI components
private Label mLabel;
@@ -79,16 +84,14 @@ public class SysinfoPanel extends TablePanel implements IShellOutputReceiver {
private Composite mPieChartComposite;
private Composite mStackedBarComposite;
- // The bugreport file to process
- private File mDataFile;
-
- // To get output from adb commands
- private FileOutputStream mTempStream;
-
// Selects the current display: MODE_CPU, etc.
private int mMode = 0;
private String mGfxPackageName;
+ private static final Object RECEIVER_LOCK = new Object();
+ @GuardedBy("RECEIVER_LOCK")
+ private ShellOutputReceiver mLastOutputReceiver;
+
private static final int MODE_CPU = 0;
private static final int MODE_MEMINFO = 1;
private static final int MODE_GFXINFO = 2;
@@ -196,12 +199,14 @@ public class SysinfoPanel extends TablePanel implements IShellOutputReceiver {
@Override
public void run() {
try {
- initShellOutputBuffer();
+ String header = null;
if (mMode == MODE_MEMINFO) {
// Hack to add bugreport-style section header for meminfo
- mTempStream.write("------ MEMORY INFO ------\n".getBytes());
+ header = "------ MEMORY INFO ------\n";
}
- getCurrentDevice().executeShellCommand(command, SysinfoPanel.this);
+
+ IShellOutputReceiver receiver = initShellOutputBuffer(header);
+ getCurrentDevice().executeShellCommand(command, receiver);
} catch (IOException e) {
Log.e("DDMS", e);
} catch (TimeoutException e) {
@@ -277,52 +282,18 @@ public class SysinfoPanel extends TablePanel implements IShellOutputReceiver {
*
* @throws IOException on file error
*/
- void initShellOutputBuffer() throws IOException {
- mDataFile = File.createTempFile("ddmsfile", ".txt");
- mDataFile.deleteOnExit();
- mTempStream = new FileOutputStream(mDataFile);
- }
-
- /**
- * Adds output to the temp file. IShellOutputReceiver method. Called by
- * executeShellCommand().
- */
- @Override
- public void addOutput(byte[] data, int offset, int length) {
- try {
- mTempStream.write(data, offset, length);
- } catch (IOException e) {
- Log.e("DDMS", e);
- }
- }
+ IShellOutputReceiver initShellOutputBuffer(String header) throws IOException {
+ File f = File.createTempFile("ddmsfile", ".txt");
+ f.deleteOnExit();
- /**
- * Processes output from shell command. IShellOutputReceiver method. The
- * output is passed to generateDataset(). Called by executeShellCommand() on
- * completion.
- */
- @Override
- public void flush() {
- if (mTempStream != null) {
- try {
- mTempStream.close();
- generateDataset(mDataFile);
- mTempStream = null;
- mDataFile = null;
- } catch (IOException e) {
- Log.e("DDMS", e);
+ synchronized (RECEIVER_LOCK) {
+ if (mLastOutputReceiver != null) {
+ mLastOutputReceiver.cancel();
}
- }
- }
- /**
- * IShellOutputReceiver method.
- *
- * @return false - don't cancel
- */
- @Override
- public boolean isCancelled() {
- return false;
+ mLastOutputReceiver = new ShellOutputReceiver(f, header);
+ }
+ return mLastOutputReceiver;
}
/**
@@ -346,9 +317,7 @@ public class SysinfoPanel extends TablePanel implements IShellOutputReceiver {
@Override
public void widgetSelected(SelectionEvent e) {
mMode = mDisplayMode.getSelectionIndex();
- if (mDataFile != null) {
- generateDataset(mDataFile);
- } else if (getCurrentDevice() != null) {
+ if (getCurrentDevice() != null) {
loadFromDevice();
}
}
@@ -904,4 +873,58 @@ public class SysinfoPanel extends TablePanel implements IShellOutputReceiver {
});
}
+ private class ShellOutputReceiver implements IShellOutputReceiver {
+ private final OutputStream mStream;
+ private final File mFile;
+ private AtomicBoolean mCancelled = new AtomicBoolean();
+
+ public ShellOutputReceiver(File f, String header) {
+ mFile = f;
+ try {
+ mStream = new FileOutputStream(f);
+ } catch (FileNotFoundException e) {
+ throw new IllegalArgumentException(e);
+ }
+
+ if (header != null) {
+ byte[] data = header.getBytes();
+ addOutput(data, 0, data.length);
+ }
+ }
+
+ @Override
+ public void addOutput(byte[] data, int offset, int length) {
+ try {
+ mStream.write(data, offset, length);
+ } catch (IOException e) {
+ Log.e("DDMS", e);
+ }
+ }
+
+ @Override
+ public void flush() {
+ try {
+ mStream.close();
+ } catch (IOException e) {
+ Log.e("DDMS", e);
+ }
+
+ if (!isCancelled()) {
+ generateDataset(mFile);
+ }
+ }
+
+ @Override
+ public boolean isCancelled() {
+ return mCancelled.get();
+ }
+
+ public void cancel() {
+ mCancelled.set(true);
+ }
+
+ public File getDataFile() {
+ return mFile;
+ }
+ }
}
diff --git a/ddms/ddmuilib/src/main/java/com/android/ddmuilib/heap/NativeDiffAllocationInfo.java b/ddms/ddmuilib/src/main/java/com/android/ddmuilib/heap/NativeDiffAllocationInfo.java
new file mode 100644
index 0000000..bdd9b39
--- /dev/null
+++ b/ddms/ddmuilib/src/main/java/com/android/ddmuilib/heap/NativeDiffAllocationInfo.java
@@ -0,0 +1,67 @@
+/*
+ * Copyright (C) 2013 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.ddmuilib.heap;
+
+import com.android.ddmlib.NativeAllocationInfo;
+import com.android.ddmlib.NativeStackCallInfo;
+
+import java.util.List;
+
+/**
+ * {@link NativeDiffAllocationInfo} stores the difference in the allocation
+ * counts between two allocations with the same stack trace.
+ *
+ * Since only the allocation counts are different, it delegates all other functionality to
+ * one of the allocations and just maintains the allocation count.
+ */
+public class NativeDiffAllocationInfo extends NativeAllocationInfo {
+ private final NativeAllocationInfo info;
+
+ public NativeDiffAllocationInfo(NativeAllocationInfo cur, NativeAllocationInfo prev) {
+ super(cur.getSize(), getNewAllocations(cur, prev));
+ info = cur;
+ }
+
+ private static int getNewAllocations(NativeAllocationInfo n1, NativeAllocationInfo n2) {
+ return n1.getAllocationCount() - n2.getAllocationCount();
+ }
+
+ @Override
+ public boolean isStackCallResolved() {
+ return info.isStackCallResolved();
+ }
+
+ @Override
+ public List<Long> getStackCallAddresses() {
+ return info.getStackCallAddresses();
+ }
+
+ @Override
+ public synchronized List<NativeStackCallInfo> getResolvedStackCall() {
+ return info.getResolvedStackCall();
+ }
+
+ @Override
+ public synchronized NativeStackCallInfo getRelevantStackCallInfo() {
+ return info.getRelevantStackCallInfo();
+ }
+
+ @Override
+ public boolean isZygoteChild() {
+ return info.isZygoteChild();
+ }
+}
diff --git a/ddms/ddmuilib/src/main/java/com/android/ddmuilib/heap/NativeHeapDiffSnapshot.java b/ddms/ddmuilib/src/main/java/com/android/ddmuilib/heap/NativeHeapDiffSnapshot.java
index 9eb6ddf..e7977bb 100644
--- a/ddms/ddmuilib/src/main/java/com/android/ddmuilib/heap/NativeHeapDiffSnapshot.java
+++ b/ddms/ddmuilib/src/main/java/com/android/ddmuilib/heap/NativeHeapDiffSnapshot.java
@@ -17,6 +17,7 @@
package com.android.ddmuilib.heap;
import com.android.ddmlib.NativeAllocationInfo;
+import com.google.common.collect.Sets;
import java.util.ArrayList;
import java.util.HashSet;
@@ -46,8 +47,44 @@ public class NativeHeapDiffSnapshot extends NativeHeapSnapshot {
NativeHeapSnapshot oldSnapshot) {
Set<NativeAllocationInfo> allocations =
new HashSet<NativeAllocationInfo>(newSnapshot.getAllocations());
+
+ // compute new allocations
allocations.removeAll(oldSnapshot.getAllocations());
- return new ArrayList<NativeAllocationInfo>(allocations);
+
+ // Account for allocations with the same stack trace that were
+ // present in the older set of allocations.
+ // e.g. A particular stack trace might have had 3 allocations in snapshot 1,
+ // and 2 more in snapshot 2. We only want to show the new allocations (just the 2 from
+ // snapshot 2). However, the way the allocations are stored, in snapshot 2, we'll see
+ // 5 allocations at the stack trace. We need to subtract out the 3 from the first allocation
+ Set<NativeAllocationInfo> onlyInPrevious =
+ new HashSet<NativeAllocationInfo>(oldSnapshot.getAllocations());
+ Set<NativeAllocationInfo> newAllocations =
+ Sets.newHashSetWithExpectedSize(allocations.size());
+
+ onlyInPrevious.removeAll(newSnapshot.getAllocations());
+ for (NativeAllocationInfo current : allocations) {
+ NativeAllocationInfo old = getOldAllocationWithSameStack(current, onlyInPrevious);
+ if (old == null) {
+ newAllocations.add(current);
+ } else if (current.getAllocationCount() > old.getAllocationCount()) {
+ newAllocations.add(new NativeDiffAllocationInfo(current, old));
+ }
+ }
+
+ return new ArrayList<NativeAllocationInfo>(newAllocations);
+ }
+
+ private static NativeAllocationInfo getOldAllocationWithSameStack(
+ NativeAllocationInfo info,
+ Set<NativeAllocationInfo> allocations) {
+ for (NativeAllocationInfo a : allocations) {
+ if (info.getSize() == a.getSize() && info.stackEquals(a)) {
+ return a;
+ }
+ }
+
+ return null;
}
@Override
diff --git a/ddms/ddmuilib/src/main/java/com/android/ddmuilib/heap/NativeHeapPanel.java b/ddms/ddmuilib/src/main/java/com/android/ddmuilib/heap/NativeHeapPanel.java
index f6631b7..6802dcb 100644
--- a/ddms/ddmuilib/src/main/java/com/android/ddmuilib/heap/NativeHeapPanel.java
+++ b/ddms/ddmuilib/src/main/java/com/android/ddmuilib/heap/NativeHeapPanel.java
@@ -88,11 +88,7 @@ public class NativeHeapPanel extends BaseHeapPanel {
private static final boolean USE_OLD_RESOLVER;
static {
String useOldResolver = System.getenv("ANDROID_DDMS_OLD_SYMRESOLVER");
- if (useOldResolver != null && useOldResolver.equalsIgnoreCase("true")) {
- USE_OLD_RESOLVER = true;
- } else {
- USE_OLD_RESOLVER = false;
- }
+ USE_OLD_RESOLVER = useOldResolver != null && useOldResolver.equalsIgnoreCase("true");
}
private final int MAX_DISPLAYED_ERROR_ITEMS = 5;
@@ -145,7 +141,6 @@ public class NativeHeapPanel extends BaseHeapPanel {
private NativeHeapProviderByLibrary mContentProviderByLibrary;
private NativeHeapLabelProvider mDetailsTreeLabelProvider;
- private ToolBar mDetailsToolBar;
private ToolItem mGroupByButton;
private ToolItem mDiffsOnlyButton;
private ToolItem mShowZygoteAllocationsButton;
@@ -458,7 +453,7 @@ public class NativeHeapPanel extends BaseHeapPanel {
items.add("Snapshot " + (i + 1));
}
- mSnapshotIndexCombo.setItems(items.toArray(new String[0]));
+ mSnapshotIndexCombo.setItems(items.toArray(new String[items.size()]));
if (numSnapshots > 0) {
mSnapshotIndexCombo.setEnabled(true);
@@ -633,7 +628,7 @@ public class NativeHeapPanel extends BaseHeapPanel {
// Create: Display: __________________
createLabel(c, "Display:");
- mSnapshotIndexCombo = new Combo(c, SWT.NONE | SWT.READ_ONLY);
+ mSnapshotIndexCombo = new Combo(c, SWT.READ_ONLY);
mSnapshotIndexCombo.setItems(new String[] {"No heap snapshots available."});
mSnapshotIndexCombo.setEnabled(false);
mSnapshotIndexCombo.addSelectionListener(new SelectionAdapter() {
@@ -698,8 +693,8 @@ public class NativeHeapPanel extends BaseHeapPanel {
c.setLayout(new FormLayout());
c.setLayoutData(new GridData(GridData.FILL_BOTH));
- mDetailsToolBar = new ToolBar(c, SWT.FLAT | SWT.BORDER);
- initializeDetailsToolBar(mDetailsToolBar);
+ ToolBar detailsToolBar = new ToolBar(c, SWT.FLAT | SWT.BORDER);
+ initializeDetailsToolBar(detailsToolBar);
Tree detailsTree = new Tree(c, SWT.VIRTUAL | SWT.BORDER | SWT.MULTI);
initializeDetailsTree(detailsTree);
@@ -717,10 +712,10 @@ public class NativeHeapPanel extends BaseHeapPanel {
data.top = new FormAttachment(0, 0);
data.left = new FormAttachment(0, 0);
data.right = new FormAttachment(100, 0);
- mDetailsToolBar.setLayoutData(data);
+ detailsToolBar.setLayoutData(data);
data = new FormData();
- data.top = new FormAttachment(mDetailsToolBar, 0);
+ data.top = new FormAttachment(detailsToolBar, 0);
data.bottom = new FormAttachment(sash, 0);
data.left = new FormAttachment(0, 0);
data.right = new FormAttachment(100, 0);
@@ -864,33 +859,27 @@ public class NativeHeapPanel extends BaseHeapPanel {
tree.setHeaderVisible(true);
tree.setLinesVisible(true);
- List<String> properties = Arrays.asList(new String[] {
- "Library",
+ List<String> properties = Arrays.asList("Library",
"Total",
"Percentage",
"Count",
"Size",
- "Method",
- });
+ "Method");
- List<String> sampleValues = Arrays.asList(new String[] {
- "/path/in/device/to/system/library.so",
+ List<String> sampleValues = Arrays.asList("/path/in/device/to/system/library.so",
"123456789",
" 100%",
"123456789",
"123456789",
- "PossiblyLongDemangledMethodName",
- });
+ "PossiblyLongDemangledMethodName");
// right align numeric values
- List<Integer> swtFlags = Arrays.asList(new Integer[] {
- SWT.LEFT,
+ List<Integer> swtFlags = Arrays.asList(SWT.LEFT,
SWT.RIGHT,
SWT.RIGHT,
SWT.RIGHT,
SWT.RIGHT,
- SWT.LEFT,
- });
+ SWT.LEFT);
for (int i = 0; i < properties.size(); i++) {
String p = properties.get(i);
@@ -931,21 +920,17 @@ public class NativeHeapPanel extends BaseHeapPanel {
tree.setHeaderVisible(true);
tree.setLinesVisible(true);
- List<String> properties = Arrays.asList(new String[] {
- "Address",
+ List<String> properties = Arrays.asList("Address",
"Library",
"Method",
"File",
- "Line",
- });
+ "Line");
- List<String> sampleValues = Arrays.asList(new String[] {
- "0x1234_5678",
+ List<String> sampleValues = Arrays.asList("0x1234_5678",
"/path/in/device/to/system/library.so",
"PossiblyLongDemangledMethodName",
"/android/out/prefix/in/home/directory/to/path/in/device/to/system/library.so",
- "2000",
- });
+ "2000");
for (int i = 0; i < properties.size(); i++) {
String p = properties.get(i);
diff --git a/ddms/ddmuilib/src/main/java/com/android/ddmuilib/heap/NativeHeapProviderByLibrary.java b/ddms/ddmuilib/src/main/java/com/android/ddmuilib/heap/NativeHeapProviderByLibrary.java
index b786bfa..40b5421 100644
--- a/ddms/ddmuilib/src/main/java/com/android/ddmuilib/heap/NativeHeapProviderByLibrary.java
+++ b/ddms/ddmuilib/src/main/java/com/android/ddmuilib/heap/NativeHeapProviderByLibrary.java
@@ -56,6 +56,9 @@ public class NativeHeapProviderByLibrary implements ILazyTreeContentProvider {
if (element instanceof NativeHeapSnapshot) {
NativeHeapSnapshot snapshot = (NativeHeapSnapshot) element;
childCount = getLibraryAllocations(snapshot).size();
+ } else if (element instanceof NativeLibraryAllocationInfo) {
+ NativeLibraryAllocationInfo info = (NativeLibraryAllocationInfo) element;
+ childCount = info.getAllocations().size();
}
mViewer.setChildCount(element, childCount);
diff --git a/ddms/ddmuilib/src/main/java/com/android/ddmuilib/heap/NativeSymbolResolverTask.java b/ddms/ddmuilib/src/main/java/com/android/ddmuilib/heap/NativeSymbolResolverTask.java
index 1a75c6e..ed265a4 100644
--- a/ddms/ddmuilib/src/main/java/com/android/ddmuilib/heap/NativeSymbolResolverTask.java
+++ b/ddms/ddmuilib/src/main/java/com/android/ddmuilib/heap/NativeSymbolResolverTask.java
@@ -161,7 +161,7 @@ public class NativeSymbolResolverTask implements IRunnableWithProgress {
private void resolveAddresses(NativeLibraryMapInfo lib, String libPath,
Set<Long> addressesToResolve) {
- Process addr2line = null;
+ Process addr2line;
try {
addr2line = new ProcessBuilder(ADDR2LINE,
"-C", // demangle
@@ -183,7 +183,7 @@ public class NativeSymbolResolverTask implements IRunnableWithProgress {
long libStartAddress = isExecutable(lib) ? 0 : lib.getStartAddress();
try {
for (Long addr : addressesToResolve) {
- long offset = addr.longValue() - libStartAddress;
+ long offset = addr - libStartAddress;
addressWriter.write(Long.toHexString(offset));
addressWriter.newLine();
addressWriter.flush();
@@ -191,7 +191,7 @@ public class NativeSymbolResolverTask implements IRunnableWithProgress {
String sourceFile = resultReader.readLine();
mAddressResolution.put(addr,
- new NativeStackCallInfo(addr.longValue(),
+ new NativeStackCallInfo(addr,
lib.getLibraryName(),
method,
sourceFile));
@@ -233,7 +233,7 @@ public class NativeSymbolResolverTask implements IRunnableWithProgress {
private void markAddressNotResolvable(NativeLibraryMapInfo lib, Long addr) {
mAddressResolution.put(addr,
- new NativeStackCallInfo(addr.longValue(),
+ new NativeStackCallInfo(addr,
lib.getLibraryName(),
Long.toHexString(addr),
""));
diff --git a/ddms/ddmuilib/src/main/java/com/android/ddmuilib/vmtrace/VmTraceOptionsDialog.java b/ddms/ddmuilib/src/main/java/com/android/ddmuilib/vmtrace/VmTraceOptionsDialog.java
new file mode 100644
index 0000000..b3cfb4e
--- /dev/null
+++ b/ddms/ddmuilib/src/main/java/com/android/ddmuilib/vmtrace/VmTraceOptionsDialog.java
@@ -0,0 +1,145 @@
+/*
+ * Copyright (C) 2013 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.ddmuilib.vmtrace;
+
+import org.eclipse.jface.dialogs.Dialog;
+import org.eclipse.jface.dialogs.IDialogConstants;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.ModifyEvent;
+import org.eclipse.swt.events.ModifyListener;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.swt.widgets.Text;
+
+/** Dialog that allows users to select between method tracing or sampler based profiling. */
+public class VmTraceOptionsDialog extends Dialog {
+ private static final int DEFAULT_SAMPLING_INTERVAL_US = 1000;
+
+ // Static variables that maintain state across invocations of the dialog
+ private static boolean sTracingEnabled = true;
+ private static int sSamplingIntervalUs = DEFAULT_SAMPLING_INTERVAL_US;
+
+ public VmTraceOptionsDialog(Shell parentShell) {
+ super(parentShell);
+ }
+
+ @Override
+ protected void configureShell(Shell newShell) {
+ super.configureShell(newShell);
+ newShell.setText("Profiling Options");
+ }
+
+ @Override
+ protected Control createDialogArea(Composite shell) {
+ int horizontalIndent = 30;
+
+ Composite parent = (Composite) super.createDialogArea(shell);
+ Composite c = new Composite(parent, SWT.NONE);
+ c.setLayout(new GridLayout(2, false));
+ c.setLayoutData(new GridData(GridData.FILL_BOTH));
+
+ final Button useTracingButton = new Button(c, SWT.RADIO);
+ useTracingButton.setText("Trace based profiling");
+ useTracingButton.setSelection(sTracingEnabled);
+ GridData gd = new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING,
+ GridData.VERTICAL_ALIGN_CENTER, true, true, 2, 1);
+ useTracingButton.setLayoutData(gd);
+
+ Label l = new Label(c, SWT.NONE);
+ l.setText("Trace based profiling works by tracing the entry and exit of every method.\n"
+ + "This gives an accurate view of the execution, but has a high overhead.");
+ gd = new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING, GridData.VERTICAL_ALIGN_CENTER, true,
+ true, 2, 1);
+ gd.horizontalIndent = horizontalIndent;
+ l.setLayoutData(gd);
+
+ final Button useSamplingButton = new Button(c, SWT.RADIO);
+ useSamplingButton.setText("Sample based profiling");
+ useSamplingButton.setSelection(!sTracingEnabled);
+ gd = new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING, GridData.VERTICAL_ALIGN_CENTER, true,
+ true, 2, 1);
+ useSamplingButton.setLayoutData(gd);
+
+ l = new Label(c, SWT.NONE);
+ l.setText("Sample based profiling works by interrupting the VM at a given frequency and "
+ + "collecting the call stacks at that time.\n"
+ + "This has a much lower overhead, but statistical sampling requires longer runs "
+ + "to obtain a representative sample.");
+ gd = new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING, GridData.VERTICAL_ALIGN_CENTER, true,
+ true, 2, 1);
+ gd.horizontalIndent = horizontalIndent;
+ l.setLayoutData(gd);
+
+ l = new Label(c, SWT.NONE);
+ l.setText("Sampling frequency (microseconds): ");
+ gd = new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING, GridData.VERTICAL_ALIGN_END,
+ false, true);
+ gd.horizontalIndent = horizontalIndent;
+ l.setLayoutData(gd);
+
+ final Text samplingIntervalTextField = new Text(c, SWT.BORDER);
+ gd = new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING, GridData.VERTICAL_ALIGN_CENTER, true,
+ true);
+ gd.widthHint = 100;
+ samplingIntervalTextField.setLayoutData(gd);
+ samplingIntervalTextField.setEnabled(!sTracingEnabled);
+ samplingIntervalTextField.setText(Integer.toString(sSamplingIntervalUs));
+ samplingIntervalTextField.addModifyListener(new ModifyListener() {
+ @Override
+ public void modifyText(ModifyEvent modifyEvent) {
+ int v = getIntegerValue(samplingIntervalTextField.getText());
+ getButton(IDialogConstants.OK_ID).setEnabled(v > 0);
+ sSamplingIntervalUs = v > 0 ? v : DEFAULT_SAMPLING_INTERVAL_US;
+ }
+
+ private int getIntegerValue(String text) {
+ try {
+ return Integer.parseInt(text);
+ } catch (NumberFormatException e) {
+ return -1;
+ }
+ }
+ });
+
+ SelectionAdapter selectionAdapter = new SelectionAdapter() {
+ @Override
+ public void widgetSelected(SelectionEvent event) {
+ sTracingEnabled = useTracingButton.getSelection();
+ samplingIntervalTextField.setEnabled(!sTracingEnabled);
+ }
+ };
+ useTracingButton.addSelectionListener(selectionAdapter);
+ useSamplingButton.addSelectionListener(selectionAdapter);
+
+ return c;
+ }
+
+ public boolean shouldUseTracing() {
+ return sTracingEnabled;
+ }
+
+ public int getSamplingIntervalMicros() {
+ return sSamplingIntervalUs;
+ }
+}
diff --git a/hierarchyviewer2/app/.settings/org.eclipse.jdt.core.prefs b/hierarchyviewer2/app/.settings/org.eclipse.jdt.core.prefs
index 9dbff07..ea66196 100644
--- a/hierarchyviewer2/app/.settings/org.eclipse.jdt.core.prefs
+++ b/hierarchyviewer2/app/.settings/org.eclipse.jdt.core.prefs
@@ -48,10 +48,10 @@ org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=ignor
org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning
org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning
org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore
-org.eclipse.jdt.core.compiler.problem.nullAnnotationInferenceConflict=error
-org.eclipse.jdt.core.compiler.problem.nullReference=error
+org.eclipse.jdt.core.compiler.problem.nullAnnotationInferenceConflict=warning
+org.eclipse.jdt.core.compiler.problem.nullReference=warning
org.eclipse.jdt.core.compiler.problem.nullSpecInsufficientInfo=warning
-org.eclipse.jdt.core.compiler.problem.nullSpecViolation=error
+org.eclipse.jdt.core.compiler.problem.nullSpecViolation=warning
org.eclipse.jdt.core.compiler.problem.nullUncheckedConversion=ignore
org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning
org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore
diff --git a/hierarchyviewer2/app/etc/hierarchyviewer.bat b/hierarchyviewer2/app/etc/hierarchyviewer.bat
index 432294d..dbb5664 100755
--- a/hierarchyviewer2/app/etc/hierarchyviewer.bat
+++ b/hierarchyviewer2/app/etc/hierarchyviewer.bat
@@ -33,14 +33,14 @@ call lib\find_java.bat
if not defined java_exe goto :EOF
set jarfile=hierarchyviewer2.jar
-set frameworkdir=
+set frameworkdir=.
set libdir=
-if exist %frameworkdir%%jarfile% goto JarFileOk
- set frameworkdir=lib\
+if exist %frameworkdir%\%jarfile% goto JarFileOk
+ set frameworkdir=lib
-if exist %frameworkdir%%jarfile% goto JarFileOk
- set frameworkdir=..\framework\
+if exist %frameworkdir%\%jarfile% goto JarFileOk
+ set frameworkdir=..\framework
:JarFileOk
@@ -49,7 +49,7 @@ if debug NEQ "%1" goto NoDebug
shift 1
:NoDebug
-set jarpath=%frameworkdir%%jarfile%;%frameworkdir%hierarchyviewerlib.jar;%frameworkdir%swtmenubar.jar
+set jarpath=%frameworkdir%\%jarfile%;%frameworkdir%\hierarchyviewerlib.jar;%frameworkdir%\swtmenubar.jar
if not defined ANDROID_SWT goto QueryArch
set swt_path=%ANDROID_SWT%
@@ -57,11 +57,11 @@ if not defined ANDROID_SWT goto QueryArch
:QueryArch
- for /f %%a in ('%java_exe% -jar %frameworkdir%archquery.jar') do set swt_path=%frameworkdir%%%a
+ for /f "delims=" %%a in ('"%java_exe%" -jar %frameworkdir%\archquery.jar') do set swt_path=%frameworkdir%\%%a
:SwtDone
-if exist %swt_path% goto SetPath
+if exist "%swt_path%" goto SetPath
echo SWT folder '%swt_path%' does not exist.
echo Please set ANDROID_SWT to point to the folder containing swt.jar for your platform.
exit /B
@@ -70,6 +70,6 @@ if exist %swt_path% goto SetPath
echo The standalone version of hieararchyviewer is deprecated.
echo Please use Android Device Monitor (tools/monitor.bat) instead.
-call %java_exe% %java_debug% -Xmx512m -Dcom.android.hierarchyviewer.bindir=%prog_dir% -classpath "%jarpath%;%swt_path%\swt.jar" com.android.hierarchyviewer.HierarchyViewerApplication %*
+call "%java_exe%" %java_debug% -Xmx512m "-Dcom.android.hierarchyviewer.bindir=%prog_dir%" -classpath "%jarpath%;%swt_path%\swt.jar" com.android.hierarchyviewer.HierarchyViewerApplication %*
diff --git a/hierarchyviewer2/hierarchyviewer2lib/.settings/org.eclipse.jdt.core.prefs b/hierarchyviewer2/hierarchyviewer2lib/.settings/org.eclipse.jdt.core.prefs
index 9dbff07..ea66196 100644
--- a/hierarchyviewer2/hierarchyviewer2lib/.settings/org.eclipse.jdt.core.prefs
+++ b/hierarchyviewer2/hierarchyviewer2lib/.settings/org.eclipse.jdt.core.prefs
@@ -48,10 +48,10 @@ org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=ignor
org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning
org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning
org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore
-org.eclipse.jdt.core.compiler.problem.nullAnnotationInferenceConflict=error
-org.eclipse.jdt.core.compiler.problem.nullReference=error
+org.eclipse.jdt.core.compiler.problem.nullAnnotationInferenceConflict=warning
+org.eclipse.jdt.core.compiler.problem.nullReference=warning
org.eclipse.jdt.core.compiler.problem.nullSpecInsufficientInfo=warning
-org.eclipse.jdt.core.compiler.problem.nullSpecViolation=error
+org.eclipse.jdt.core.compiler.problem.nullSpecViolation=warning
org.eclipse.jdt.core.compiler.problem.nullUncheckedConversion=ignore
org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning
org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore
diff --git a/hierarchyviewer2/hierarchyviewer2lib/src/main/java/com/android/hierarchyviewerlib/device/DeviceConnection.java b/hierarchyviewer2/hierarchyviewer2lib/src/main/java/com/android/hierarchyviewerlib/device/DeviceConnection.java
index f750d5c..24d152b 100644
--- a/hierarchyviewer2/hierarchyviewer2lib/src/main/java/com/android/hierarchyviewerlib/device/DeviceConnection.java
+++ b/hierarchyviewer2/hierarchyviewer2lib/src/main/java/com/android/hierarchyviewerlib/device/DeviceConnection.java
@@ -17,6 +17,7 @@
package com.android.hierarchyviewerlib.device;
import com.android.ddmlib.IDevice;
+import com.google.common.base.Charsets;
import java.io.BufferedReader;
import java.io.BufferedWriter;
@@ -54,16 +55,16 @@ public class DeviceConnection {
public BufferedReader getInputStream() throws IOException {
if (mIn == null) {
- mIn = new BufferedReader(new InputStreamReader(mSocketChannel.socket().getInputStream()));
+ mIn = new BufferedReader(new InputStreamReader(
+ mSocketChannel.socket().getInputStream(), Charsets.UTF_8));
}
return mIn;
}
public BufferedWriter getOutputStream() throws IOException {
if (mOut == null) {
- mOut =
- new BufferedWriter(new OutputStreamWriter(mSocketChannel.socket()
- .getOutputStream()));
+ mOut = new BufferedWriter(new OutputStreamWriter(
+ mSocketChannel.socket().getOutputStream(), Charsets.UTF_8));
}
return mOut;
}
diff --git a/sdklib/.settings/org.eclipse.jdt.core.prefs b/sdklib/.settings/org.eclipse.jdt.core.prefs
index 9dbff07..ea66196 100644
--- a/sdklib/.settings/org.eclipse.jdt.core.prefs
+++ b/sdklib/.settings/org.eclipse.jdt.core.prefs
@@ -48,10 +48,10 @@ org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=ignor
org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning
org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning
org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore
-org.eclipse.jdt.core.compiler.problem.nullAnnotationInferenceConflict=error
-org.eclipse.jdt.core.compiler.problem.nullReference=error
+org.eclipse.jdt.core.compiler.problem.nullAnnotationInferenceConflict=warning
+org.eclipse.jdt.core.compiler.problem.nullReference=warning
org.eclipse.jdt.core.compiler.problem.nullSpecInsufficientInfo=warning
-org.eclipse.jdt.core.compiler.problem.nullSpecViolation=error
+org.eclipse.jdt.core.compiler.problem.nullSpecViolation=warning
org.eclipse.jdt.core.compiler.problem.nullUncheckedConversion=ignore
org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning
org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore
diff --git a/sdkmanager/sdkuilib/.settings/org.eclipse.jdt.core.prefs b/sdkmanager/sdkuilib/.settings/org.eclipse.jdt.core.prefs
index 9dbff07..ea66196 100644
--- a/sdkmanager/sdkuilib/.settings/org.eclipse.jdt.core.prefs
+++ b/sdkmanager/sdkuilib/.settings/org.eclipse.jdt.core.prefs
@@ -48,10 +48,10 @@ org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=ignor
org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning
org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning
org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore
-org.eclipse.jdt.core.compiler.problem.nullAnnotationInferenceConflict=error
-org.eclipse.jdt.core.compiler.problem.nullReference=error
+org.eclipse.jdt.core.compiler.problem.nullAnnotationInferenceConflict=warning
+org.eclipse.jdt.core.compiler.problem.nullReference=warning
org.eclipse.jdt.core.compiler.problem.nullSpecInsufficientInfo=warning
-org.eclipse.jdt.core.compiler.problem.nullSpecViolation=error
+org.eclipse.jdt.core.compiler.problem.nullSpecViolation=warning
org.eclipse.jdt.core.compiler.problem.nullUncheckedConversion=ignore
org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning
org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore
diff --git a/sdkmanager/sdkuilib/sdkuilib.iml b/sdkmanager/sdkuilib/sdkuilib.iml
new file mode 100644
index 0000000..fd2fdde
--- /dev/null
+++ b/sdkmanager/sdkuilib/sdkuilib.iml
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<module type="JAVA_MODULE" version="4">
+ <component name="NewModuleRootManager" inherit-compiler-output="true">
+ <exclude-output />
+ <content url="file://$MODULE_DIR$">
+ <sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
+ <sourceFolder url="file://$MODULE_DIR$/src/test/java" isTestSource="true" />
+ </content>
+ <orderEntry type="inheritedJdk" />
+ <orderEntry type="sourceFolder" forTests="false" />
+ <orderEntry type="module" module-name="common" />
+ <orderEntry type="module" module-name="swtmenubar" />
+ <orderEntry type="module" module-name="sdklib" />
+ <orderEntry type="library" name="swt" level="project" />
+ <orderEntry type="library" name="org-eclipse-jface-3.6.2" level="project" />
+ <orderEntry type="library" name="org-eclipse-core-commands-3.6.0" level="project" />
+ <orderEntry type="library" name="org-eclipse-equinox-common-3.6.0" level="project" />
+ </component>
+</module>
+
diff --git a/sdkmanager/sdkuilib/src/main/java/com/android/sdkuilib/internal/repository/core/PackagesDiffLogic.java b/sdkmanager/sdkuilib/src/main/java/com/android/sdkuilib/internal/repository/core/PackagesDiffLogic.java
index 1d72bbe..01ea803 100755
--- a/sdkmanager/sdkuilib/src/main/java/com/android/sdkuilib/internal/repository/core/PackagesDiffLogic.java
+++ b/sdkmanager/sdkuilib/src/main/java/com/android/sdkuilib/internal/repository/core/PackagesDiffLogic.java
@@ -34,7 +34,7 @@ import com.android.sdklib.internal.repository.updater.PkgItem;
import com.android.sdklib.internal.repository.updater.PkgItem.PkgState;
import com.android.sdklib.repository.FullRevision;
import com.android.sdklib.repository.FullRevision.PreviewComparison;
-import com.android.sdklib.util.SparseArray;
+import com.android.utils.SparseArray;
import com.android.sdkuilib.internal.repository.SwtUpdaterData;
import com.android.sdkuilib.internal.repository.ui.PackagesPageIcons;
import com.android.utils.Pair;
diff --git a/sdkmanager/sdkuilib/src/main/java/com/android/sdkuilib/internal/repository/icons/accept_icon16.png b/sdkmanager/sdkuilib/src/main/java/com/android/sdkuilib/internal/repository/icons/accept_icon16.png
index a9483fb..ae61f7d 100755
Binary files a/sdkmanager/sdkuilib/src/main/java/com/android/sdkuilib/internal/repository/icons/accept_icon16.png and b/sdkmanager/sdkuilib/src/main/java/com/android/sdkuilib/internal/repository/icons/accept_icon16.png differ
diff --git a/sdkmanager/sdkuilib/src/main/java/com/android/sdkuilib/internal/repository/icons/addon_pkg_16.png b/sdkmanager/sdkuilib/src/main/java/com/android/sdkuilib/internal/repository/icons/addon_pkg_16.png
index ca6a231..addef8e 100755
Binary files a/sdkmanager/sdkuilib/src/main/java/com/android/sdkuilib/internal/repository/icons/addon_pkg_16.png and b/sdkmanager/sdkuilib/src/main/java/com/android/sdkuilib/internal/repository/icons/addon_pkg_16.png differ
diff --git a/sdkmanager/sdkuilib/src/main/java/com/android/sdkuilib/internal/repository/icons/buildtool_pkg_16.png b/sdkmanager/sdkuilib/src/main/java/com/android/sdkuilib/internal/repository/icons/buildtool_pkg_16.png
index a4cb335..9b917da 100755
Binary files a/sdkmanager/sdkuilib/src/main/java/com/android/sdkuilib/internal/repository/icons/buildtool_pkg_16.png and b/sdkmanager/sdkuilib/src/main/java/com/android/sdkuilib/internal/repository/icons/buildtool_pkg_16.png differ
diff --git a/sdkmanager/sdkuilib/src/main/java/com/android/sdkuilib/internal/repository/icons/devman_generic_16.png b/sdkmanager/sdkuilib/src/main/java/com/android/sdkuilib/internal/repository/icons/devman_generic_16.png
index 6f59cd4..c727351 100755
Binary files a/sdkmanager/sdkuilib/src/main/java/com/android/sdkuilib/internal/repository/icons/devman_generic_16.png and b/sdkmanager/sdkuilib/src/main/java/com/android/sdkuilib/internal/repository/icons/devman_generic_16.png differ
diff --git a/sdkmanager/sdkuilib/src/main/java/com/android/sdkuilib/internal/repository/icons/devman_manufacturer_16.png b/sdkmanager/sdkuilib/src/main/java/com/android/sdkuilib/internal/repository/icons/devman_manufacturer_16.png
index 422276d..c727351 100755
Binary files a/sdkmanager/sdkuilib/src/main/java/com/android/sdkuilib/internal/repository/icons/devman_manufacturer_16.png and b/sdkmanager/sdkuilib/src/main/java/com/android/sdkuilib/internal/repository/icons/devman_manufacturer_16.png differ
diff --git a/sdkmanager/sdkuilib/src/main/java/com/android/sdkuilib/internal/repository/icons/devman_user_16.png b/sdkmanager/sdkuilib/src/main/java/com/android/sdkuilib/internal/repository/icons/devman_user_16.png
index f8a173c..1f4608f 100755
Binary files a/sdkmanager/sdkuilib/src/main/java/com/android/sdkuilib/internal/repository/icons/devman_user_16.png and b/sdkmanager/sdkuilib/src/main/java/com/android/sdkuilib/internal/repository/icons/devman_user_16.png differ
diff --git a/sdkmanager/sdkuilib/src/main/java/com/android/sdkuilib/internal/repository/icons/doc_pkg_16.png b/sdkmanager/sdkuilib/src/main/java/com/android/sdkuilib/internal/repository/icons/doc_pkg_16.png
index 186b3b1..a2be37a 100755
Binary files a/sdkmanager/sdkuilib/src/main/java/com/android/sdkuilib/internal/repository/icons/doc_pkg_16.png and b/sdkmanager/sdkuilib/src/main/java/com/android/sdkuilib/internal/repository/icons/doc_pkg_16.png differ
diff --git a/sdkmanager/sdkuilib/src/main/java/com/android/sdkuilib/internal/repository/icons/extra_pkg_16.png b/sdkmanager/sdkuilib/src/main/java/com/android/sdkuilib/internal/repository/icons/extra_pkg_16.png
index a6529f0..7ad8a66 100755
Binary files a/sdkmanager/sdkuilib/src/main/java/com/android/sdkuilib/internal/repository/icons/extra_pkg_16.png and b/sdkmanager/sdkuilib/src/main/java/com/android/sdkuilib/internal/repository/icons/extra_pkg_16.png differ
diff --git a/sdkmanager/sdkuilib/src/main/java/com/android/sdkuilib/internal/repository/icons/log_off_16.png b/sdkmanager/sdkuilib/src/main/java/com/android/sdkuilib/internal/repository/icons/log_off_16.png
index c9d7cb7..ad2edff 100755
Binary files a/sdkmanager/sdkuilib/src/main/java/com/android/sdkuilib/internal/repository/icons/log_off_16.png and b/sdkmanager/sdkuilib/src/main/java/com/android/sdkuilib/internal/repository/icons/log_off_16.png differ
diff --git a/sdkmanager/sdkuilib/src/main/java/com/android/sdkuilib/internal/repository/icons/log_on_16.png b/sdkmanager/sdkuilib/src/main/java/com/android/sdkuilib/internal/repository/icons/log_on_16.png
index 58f4195..ed27b52 100755
Binary files a/sdkmanager/sdkuilib/src/main/java/com/android/sdkuilib/internal/repository/icons/log_on_16.png and b/sdkmanager/sdkuilib/src/main/java/com/android/sdkuilib/internal/repository/icons/log_on_16.png differ
diff --git a/sdkmanager/sdkuilib/src/main/java/com/android/sdkuilib/internal/repository/icons/pkg_incompat_16.png b/sdkmanager/sdkuilib/src/main/java/com/android/sdkuilib/internal/repository/icons/pkg_incompat_16.png
index 7ef989e..d7d3ae6 100755
Binary files a/sdkmanager/sdkuilib/src/main/java/com/android/sdkuilib/internal/repository/icons/pkg_incompat_16.png and b/sdkmanager/sdkuilib/src/main/java/com/android/sdkuilib/internal/repository/icons/pkg_incompat_16.png differ
diff --git a/sdkmanager/sdkuilib/src/main/java/com/android/sdkuilib/internal/repository/icons/pkg_installed_16.png b/sdkmanager/sdkuilib/src/main/java/com/android/sdkuilib/internal/repository/icons/pkg_installed_16.png
index 78b7e5a..7029565 100755
Binary files a/sdkmanager/sdkuilib/src/main/java/com/android/sdkuilib/internal/repository/icons/pkg_installed_16.png and b/sdkmanager/sdkuilib/src/main/java/com/android/sdkuilib/internal/repository/icons/pkg_installed_16.png differ
diff --git a/sdkmanager/sdkuilib/src/main/java/com/android/sdkuilib/internal/repository/icons/pkg_new_16.png b/sdkmanager/sdkuilib/src/main/java/com/android/sdkuilib/internal/repository/icons/pkg_new_16.png
index 0976ad4..9c93afc 100755
Binary files a/sdkmanager/sdkuilib/src/main/java/com/android/sdkuilib/internal/repository/icons/pkg_new_16.png and b/sdkmanager/sdkuilib/src/main/java/com/android/sdkuilib/internal/repository/icons/pkg_new_16.png differ
diff --git a/sdkmanager/sdkuilib/src/main/java/com/android/sdkuilib/internal/repository/icons/pkg_update_16.png b/sdkmanager/sdkuilib/src/main/java/com/android/sdkuilib/internal/repository/icons/pkg_update_16.png
index e766251..4171ba6 100755
Binary files a/sdkmanager/sdkuilib/src/main/java/com/android/sdkuilib/internal/repository/icons/pkg_update_16.png and b/sdkmanager/sdkuilib/src/main/java/com/android/sdkuilib/internal/repository/icons/pkg_update_16.png differ
diff --git a/sdkmanager/sdkuilib/src/main/java/com/android/sdkuilib/internal/repository/icons/pkgcat_16.png b/sdkmanager/sdkuilib/src/main/java/com/android/sdkuilib/internal/repository/icons/pkgcat_16.png
index cd9b807..0ee32bf 100755
Binary files a/sdkmanager/sdkuilib/src/main/java/com/android/sdkuilib/internal/repository/icons/pkgcat_16.png and b/sdkmanager/sdkuilib/src/main/java/com/android/sdkuilib/internal/repository/icons/pkgcat_16.png differ
diff --git a/sdkmanager/sdkuilib/src/main/java/com/android/sdkuilib/internal/repository/icons/platform_pkg_16.png b/sdkmanager/sdkuilib/src/main/java/com/android/sdkuilib/internal/repository/icons/platform_pkg_16.png
index 0b0744b..56e10d0 100755
Binary files a/sdkmanager/sdkuilib/src/main/java/com/android/sdkuilib/internal/repository/icons/platform_pkg_16.png and b/sdkmanager/sdkuilib/src/main/java/com/android/sdkuilib/internal/repository/icons/platform_pkg_16.png differ
diff --git a/sdkmanager/sdkuilib/src/main/java/com/android/sdkuilib/internal/repository/icons/platformtool_pkg_16.png b/sdkmanager/sdkuilib/src/main/java/com/android/sdkuilib/internal/repository/icons/platformtool_pkg_16.png
index 606a100..424fb29 100755
Binary files a/sdkmanager/sdkuilib/src/main/java/com/android/sdkuilib/internal/repository/icons/platformtool_pkg_16.png and b/sdkmanager/sdkuilib/src/main/java/com/android/sdkuilib/internal/repository/icons/platformtool_pkg_16.png differ
diff --git a/sdkmanager/sdkuilib/src/main/java/com/android/sdkuilib/internal/repository/icons/reject_icon16.png b/sdkmanager/sdkuilib/src/main/java/com/android/sdkuilib/internal/repository/icons/reject_icon16.png
index b87bbc9..18c1481 100755
Binary files a/sdkmanager/sdkuilib/src/main/java/com/android/sdkuilib/internal/repository/icons/reject_icon16.png and b/sdkmanager/sdkuilib/src/main/java/com/android/sdkuilib/internal/repository/icons/reject_icon16.png differ
diff --git a/sdkmanager/sdkuilib/src/main/java/com/android/sdkuilib/internal/repository/icons/sample_pkg_16.png b/sdkmanager/sdkuilib/src/main/java/com/android/sdkuilib/internal/repository/icons/sample_pkg_16.png
index 8d31865..11210ba 100755
Binary files a/sdkmanager/sdkuilib/src/main/java/com/android/sdkuilib/internal/repository/icons/sample_pkg_16.png and b/sdkmanager/sdkuilib/src/main/java/com/android/sdkuilib/internal/repository/icons/sample_pkg_16.png differ
diff --git a/sdkmanager/sdkuilib/src/main/java/com/android/sdkuilib/internal/repository/icons/source_pkg_16.png b/sdkmanager/sdkuilib/src/main/java/com/android/sdkuilib/internal/repository/icons/source_pkg_16.png
index 9992cda..ab08d29 100755
Binary files a/sdkmanager/sdkuilib/src/main/java/com/android/sdkuilib/internal/repository/icons/source_pkg_16.png and b/sdkmanager/sdkuilib/src/main/java/com/android/sdkuilib/internal/repository/icons/source_pkg_16.png differ
diff --git a/sdkmanager/sdkuilib/src/main/java/com/android/sdkuilib/internal/repository/icons/status_ok_16.png b/sdkmanager/sdkuilib/src/main/java/com/android/sdkuilib/internal/repository/icons/status_ok_16.png
index eeb0a6f..ae61f7d 100755
Binary files a/sdkmanager/sdkuilib/src/main/java/com/android/sdkuilib/internal/repository/icons/status_ok_16.png and b/sdkmanager/sdkuilib/src/main/java/com/android/sdkuilib/internal/repository/icons/status_ok_16.png differ
diff --git a/sdkmanager/sdkuilib/src/main/java/com/android/sdkuilib/internal/repository/icons/stop_disabled_16.png b/sdkmanager/sdkuilib/src/main/java/com/android/sdkuilib/internal/repository/icons/stop_disabled_16.png
index ae6da31..721d184 100755
Binary files a/sdkmanager/sdkuilib/src/main/java/com/android/sdkuilib/internal/repository/icons/stop_disabled_16.png and b/sdkmanager/sdkuilib/src/main/java/com/android/sdkuilib/internal/repository/icons/stop_disabled_16.png differ
diff --git a/sdkmanager/sdkuilib/src/main/java/com/android/sdkuilib/internal/repository/icons/stop_enabled_16.png b/sdkmanager/sdkuilib/src/main/java/com/android/sdkuilib/internal/repository/icons/stop_enabled_16.png
index 7ce1864..198f299 100755
Binary files a/sdkmanager/sdkuilib/src/main/java/com/android/sdkuilib/internal/repository/icons/stop_enabled_16.png and b/sdkmanager/sdkuilib/src/main/java/com/android/sdkuilib/internal/repository/icons/stop_enabled_16.png differ
diff --git a/sdkmanager/sdkuilib/src/main/java/com/android/sdkuilib/internal/repository/icons/sysimg_pkg_16.png b/sdkmanager/sdkuilib/src/main/java/com/android/sdkuilib/internal/repository/icons/sysimg_pkg_16.png
index 7795c2c..942ce47 100755
Binary files a/sdkmanager/sdkuilib/src/main/java/com/android/sdkuilib/internal/repository/icons/sysimg_pkg_16.png and b/sdkmanager/sdkuilib/src/main/java/com/android/sdkuilib/internal/repository/icons/sysimg_pkg_16.png differ
diff --git a/sdkmanager/sdkuilib/src/main/java/com/android/sdkuilib/internal/repository/icons/tool_pkg_16.png b/sdkmanager/sdkuilib/src/main/java/com/android/sdkuilib/internal/repository/icons/tool_pkg_16.png
index 8ca7710..424fb29 100755
Binary files a/sdkmanager/sdkuilib/src/main/java/com/android/sdkuilib/internal/repository/icons/tool_pkg_16.png and b/sdkmanager/sdkuilib/src/main/java/com/android/sdkuilib/internal/repository/icons/tool_pkg_16.png differ
diff --git a/sdkmanager/sdkuilib/src/main/java/com/android/sdkuilib/internal/repository/icons/unknown_icon16.png b/sdkmanager/sdkuilib/src/main/java/com/android/sdkuilib/internal/repository/icons/unknown_icon16.png
index 1b97eb7..2b255fa 100755
Binary files a/sdkmanager/sdkuilib/src/main/java/com/android/sdkuilib/internal/repository/icons/unknown_icon16.png and b/sdkmanager/sdkuilib/src/main/java/com/android/sdkuilib/internal/repository/icons/unknown_icon16.png differ
diff --git a/sdkmanager/sdkuilib/src/main/java/com/android/sdkuilib/internal/widgets/AvdCreationDialog.java b/sdkmanager/sdkuilib/src/main/java/com/android/sdkuilib/internal/widgets/AvdCreationDialog.java
index c583762..67ec3e0 100644
--- a/sdkmanager/sdkuilib/src/main/java/com/android/sdkuilib/internal/widgets/AvdCreationDialog.java
+++ b/sdkmanager/sdkuilib/src/main/java/com/android/sdkuilib/internal/widgets/AvdCreationDialog.java
@@ -40,6 +40,7 @@ import com.android.sdkuilib.internal.repository.icons.ImageFactory;
import com.android.sdkuilib.ui.GridDialog;
import com.android.utils.ILogger;
import com.android.utils.Pair;
+import com.google.common.base.Joiner;
import org.eclipse.jface.dialogs.IDialogConstants;
import org.eclipse.swt.SWT;
@@ -145,12 +146,13 @@ public class AvdCreationDialog extends GridDialog {
ImageFactory imageFactory,
ILogger log,
AvdInfo editAvdInfo) {
-
super(shell, 2, false);
mAvdManager = avdManager;
mImageFactory = imageFactory;
mSdkLog = log;
mAvdInfo = editAvdInfo;
+
+ setShellStyle(getShellStyle() | SWT.RESIZE);
}
/** Returns the AVD Created, if successful. */
@@ -411,8 +413,12 @@ public class AvdCreationDialog extends GridDialog {
mStatusIcon = new Label(mStatusComposite, SWT.NONE);
mStatusIcon.setLayoutData(new GridData(GridData.BEGINNING, GridData.BEGINNING,
false, false));
- mStatusLabel = new Label(mStatusComposite, SWT.NONE);
- mStatusLabel.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
+ mStatusLabel = new Label(mStatusComposite, SWT.WRAP);
+ GridData gridData = new GridData(SWT.FILL, SWT.FILL, true, false, 1, 1);
+ // allow for approx 3 lines of text corresponding to the number of lines in the longest
+ // error or warning
+ gridData.heightHint = 50;
+ mStatusLabel.setLayoutData(gridData);
mStatusLabel.setText(""); //$NON-NLS-1$
}
@@ -830,12 +836,12 @@ public class AvdCreationDialog extends GridDialog {
private void validatePage() {
String error = null;
- String warning = null;
+ ArrayList<String> warnings = new ArrayList<String>();
boolean valid = true;
if (mAvdName.getText().isEmpty()) {
error = "AVD Name cannot be empty";
- setPageValid(false, error, warning);
+ setPageValid(false, error, null);
return;
}
@@ -844,34 +850,65 @@ public class AvdCreationDialog extends GridDialog {
error = String.format(
"AVD name '%1$s' contains invalid characters.\nAllowed characters are: %2$s",
avdName, AvdManager.CHARS_AVD_NAME);
- setPageValid(false, error, warning);
+ setPageValid(false, error, null);
return;
}
if (mDevice.getSelectionIndex() < 0) {
- setPageValid(false, error, warning);
+ error = "No device selected";
+ setPageValid(false, error, null);
return;
}
- if (mTarget.getSelectionIndex() < 0 ||
- !mHaveSystemImage || mAbi.getSelectionIndex() < 0) {
- setPageValid(false, error, warning);
+ if (mTarget.getSelectionIndex() < 0 || !mHaveSystemImage || mAbi.getSelectionIndex() < 0) {
+ error = "No target selected";
+ setPageValid(false, error, null);
return;
}
+ // If the target is an addon, check its base platform requirement is satisfied.
+ String targetName = mTarget.getItem(mTarget.getSelectionIndex());
+ IAndroidTarget target = mCurrentTargets.get(targetName);
+ if (target != null && !target.isPlatform()) {
+
+ ISystemImage[] sis = target.getSystemImages();
+ if (sis != null && sis.length > 0) {
+ // Note: if an addon has no system-images of its own, it depends on its parent
+ // platform and it wouldn't have been loaded properly if the platform were
+ // missing so we don't need to double-check that part here.
+
+ String abiType = getSelectedAbiType(target);
+ if (abiType != null &&
+ !abiType.isEmpty() &&
+ target.getParent().getSystemImage(abiType) == null) {
+ // We have a system-image requirement but there is no such system image
+ // loaded in the parent platform. This AVD won't run properly.
+ warnings.add(
+ String.format(
+ "This AVD may not work unless you install the %1$s system image " +
+ "for %2$s (%3$s) first.",
+ abiType,
+ target.getParent().getName(),
+ target.getParent().getVersion().toString()));
+ }
+ }
+ }
+
if (mRam.getText().isEmpty()) {
- setPageValid(false, error, warning);
+ error = "Mising RAM value";
+ setPageValid(false, error, null);
return;
}
if (mVmHeap.getText().isEmpty()) {
- setPageValid(false, error, warning);
+ error = "Mising VM Heap value";
+ setPageValid(false, error, null);
return;
}
if (mDataPartition.getText().isEmpty() || mDataPartitionSize.getSelectionIndex() < 0) {
error = "Invalid Data partition size.";
- setPageValid(false, error, warning);
+ setPageValid(false, error, null);
return;
}
@@ -904,7 +941,7 @@ public class AvdCreationDialog extends GridDialog {
}
}
if (!valid) {
- setPageValid(valid, error, warning);
+ setPageValid(valid, error, null);
return;
}
@@ -917,9 +954,10 @@ public class AvdCreationDialog extends GridDialog {
}
if (mAvdInfo != null && !mAvdInfo.getName().equals(mAvdName.getText())) {
- warning = String.format("The AVD '%1$s' will be duplicated into '%2$s'.",
- mAvdInfo.getName(),
- mAvdName.getText());
+ warnings.add(
+ String.format("The AVD '%1$s' will be duplicated into '%2$s'.",
+ mAvdInfo.getName(),
+ mAvdName.getText()));
}
// On Windows, display a warning if attempting to create AVD's with RAM > 512 MB.
@@ -933,9 +971,10 @@ public class AvdCreationDialog extends GridDialog {
}
if (ramSize > 768) {
- warning = "On Windows, emulating RAM greater than 768M may fail depending on the"
- + " system load.\nTry progressively smaller values of RAM if the emulator"
- + " fails to launch.";
+ warnings.add(
+ "On Windows, emulating RAM greater than 768M may fail depending on the"
+ + " system load. Try progressively smaller values of RAM if the emulator"
+ + " fails to launch.");
}
}
@@ -944,16 +983,17 @@ public class AvdCreationDialog extends GridDialog {
error = "GPU Emulation and Snapshot cannot be used simultaneously";
}
+ String warning = Joiner.on('\n').join(warnings);
setPageValid(valid, error, warning);
return;
}
private void setPageValid(boolean valid, String error, String warning) {
mOkButton.setEnabled(valid);
- if (error != null) {
- mStatusIcon.setImage(mImageFactory.getImageByName("reject_icon16.png")); //$NON-NLS-1$
+ if (error != null && !error.isEmpty()) {
+ mStatusIcon.setImage(mImageFactory.getImageByName("reject_icon16.png")); //$NON-NLS-1$
mStatusLabel.setText(error);
- } else if (warning != null) {
+ } else if (warning != null && !warning.isEmpty()) {
mStatusIcon.setImage(mImageFactory.getImageByName("warning_icon16.png")); //$NON-NLS-1$
mStatusLabel.setText(warning);
} else {
@@ -962,6 +1002,7 @@ public class AvdCreationDialog extends GridDialog {
}
mStatusComposite.pack(true);
+ getShell().layout(true, true);
}
private boolean createAvd() {
@@ -978,18 +1019,7 @@ public class AvdCreationDialog extends GridDialog {
}
// get the abi type
- String abiType = SdkConstants.ABI_ARMEABI;
- ISystemImage[] systemImages = getSystemImages(target);
- if (systemImages.length > 0) {
- int abiIndex = mAbi.getSelectionIndex();
- if (abiIndex >= 0) {
- String prettyname = mAbi.getItem(abiIndex);
- // Extract the abi type
- int firstIndex = prettyname.indexOf("(");
- int lastIndex = prettyname.indexOf(")");
- abiType = prettyname.substring(firstIndex + 1, lastIndex);
- }
- }
+ String abiType = getSelectedAbiType(target);
// get the SD card data from the UI.
String sdName = null;
@@ -1111,6 +1141,22 @@ public class AvdCreationDialog extends GridDialog {
return success;
}
+ private String getSelectedAbiType(IAndroidTarget target) {
+ String abiType = SdkConstants.ABI_ARMEABI;
+ ISystemImage[] systemImages = getSystemImages(target);
+ if (systemImages.length > 0) {
+ int abiIndex = mAbi.getSelectionIndex();
+ if (abiIndex >= 0) {
+ String prettyname = mAbi.getItem(abiIndex);
+ // Extract the abi type
+ int firstIndex = prettyname.indexOf("(");
+ int lastIndex = prettyname.indexOf(")");
+ abiType = prettyname.substring(firstIndex + 1, lastIndex);
+ }
+ }
+ return abiType;
+ }
+
private void fillExistingAvdInfo(AvdInfo avd) {
mAvdName.setText(avd.getName());
selectDevice(avd.getDeviceManufacturer(), avd.getDeviceName());
diff --git a/sdkmanager/sdkuilib/src/test/java/com/android/sdkuilib/internal/repository/ui/MockPackagesPageImpl.java b/sdkmanager/sdkuilib/src/test/java/com/android/sdkuilib/internal/repository/ui/MockPackagesPageImpl.java
index fe854d8..afdf1e1 100755
--- a/sdkmanager/sdkuilib/src/test/java/com/android/sdkuilib/internal/repository/ui/MockPackagesPageImpl.java
+++ b/sdkmanager/sdkuilib/src/test/java/com/android/sdkuilib/internal/repository/ui/MockPackagesPageImpl.java
@@ -20,7 +20,7 @@ import com.android.sdklib.internal.repository.DownloadCache;
import com.android.sdklib.internal.repository.MockDownloadCache;
import com.android.sdklib.internal.repository.DownloadCache.Strategy;
import com.android.sdklib.internal.repository.updater.PackageLoader;
-import com.android.sdklib.util.SparseIntArray;
+import com.android.utils.SparseIntArray;
import com.android.sdkuilib.internal.repository.SwtUpdaterData;
import com.android.sdkuilib.internal.repository.core.PkgCategory;
import com.android.sdkuilib.internal.repository.core.PkgContentProvider;
diff --git a/sdkmanager/sdkuilib/src/test/java/com/android/sdkuilib/internal/repository/ui/SdkManagerUpgradeTest.java b/sdkmanager/sdkuilib/src/test/java/com/android/sdkuilib/internal/repository/ui/SdkManagerUpgradeTest.java
index a31cbac..58afe42 100755
--- a/sdkmanager/sdkuilib/src/test/java/com/android/sdkuilib/internal/repository/ui/SdkManagerUpgradeTest.java
+++ b/sdkmanager/sdkuilib/src/test/java/com/android/sdkuilib/internal/repository/ui/SdkManagerUpgradeTest.java
@@ -62,7 +62,7 @@ public class SdkManagerUpgradeTest extends SdkManagerTestCase {
" L_[] Android SDK Build-tools | | 3.0.1 | Installed\n" +
" L_[] Android SDK Build-tools | | 3 | Installed\n" +
"[] Tools (Preview Channel) | | | \n" +
- " L_[] Android SDK Build-tools | | 12.3.4 rc5 | Installed\n" +
+ " L_[] Android SDK Build-tools | | 18.3.4 rc5 | Installed\n" +
"[] Android 0.0 (API 0) | | | \n" +
" L_[] SDK Platform | | 1 | Installed\n" +
" L_[] Sources for Android SDK | | 0 | Installed\n" +
@@ -100,7 +100,7 @@ public class SdkManagerUpgradeTest extends SdkManagerTestCase {
" L_[] Android SDK Build-tools | | 3 | Installed \n" +
"[] Tools (Preview Channel) | | | \n" +
// Note: locally installed previews are always shown, even when enable previews is false.
- " L_[] Android SDK Build-tools | | 12.3.4 rc5 | Installed \n" +
+ " L_[] Android SDK Build-tools | | 18.3.4 rc5 | Installed \n" +
"[] Android 0.0 (API 0) | | | \n" +
" L_[] SDK Platform | | 1 | Installed \n" +
" L_[] Sources for Android SDK | | 0 | Installed \n" +
@@ -137,7 +137,7 @@ public class SdkManagerUpgradeTest extends SdkManagerTestCase {
" L_[] Android SDK Build-tools | | 3.0.1 | Installed \n" +
" L_[] Android SDK Build-tools | | 3 | Installed \n" +
"[] Tools (Preview Channel) | | | \n" +
- " L_[] Android SDK Build-tools | | 12.3.4 rc5 | Installed \n" +
+ " L_[] Android SDK Build-tools | | 18.3.4 rc5 | Installed \n" +
"[] Android 0.0 (API 0) | | | \n" +
" L_[] SDK Platform | | 1 | Installed \n" +
" L_[] Sources for Android SDK | | 0 | Installed \n" +
@@ -174,7 +174,7 @@ public class SdkManagerUpgradeTest extends SdkManagerTestCase {
" L_[] Android SDK Build-tools | | 3.0.1 | Installed \n" +
" L_[] Android SDK Build-tools | | 3 | Installed \n" +
"[] Tools (Preview Channel) | | | \n" +
- " L_[] Android SDK Build-tools | | 12.3.4 rc5 | Update available: rev. 12.3.4 rc15\n" +
+ " L_[] Android SDK Build-tools | | 18.3.4 rc5 | Update available: rev. 18.3.4 rc15\n" +
"[] Android 0.0 (API 0) | | | \n" +
" L_[] SDK Platform | | 1 | Installed \n" +
" L_[] Sources for Android SDK | | 0 | Installed \n" +
@@ -225,7 +225,7 @@ public class SdkManagerUpgradeTest extends SdkManagerTestCase {
"\n" +
"<sdk:build-tool>\n" +
" <sdk:revision>\n" +
- " <sdk:major>12</sdk:major>\n" +
+ " <sdk:major>18</sdk:major>\n" +
" <sdk:minor>3</sdk:minor>\n" +
" <sdk:micro>4</sdk:micro>\n" +
" <sdk:preview>15</sdk:preview>\n" +
diff --git a/sdkstats/.settings/org.eclipse.jdt.core.prefs b/sdkstats/.settings/org.eclipse.jdt.core.prefs
index 9dbff07..ea66196 100644
--- a/sdkstats/.settings/org.eclipse.jdt.core.prefs
+++ b/sdkstats/.settings/org.eclipse.jdt.core.prefs
@@ -48,10 +48,10 @@ org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=ignor
org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning
org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning
org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore
-org.eclipse.jdt.core.compiler.problem.nullAnnotationInferenceConflict=error
-org.eclipse.jdt.core.compiler.problem.nullReference=error
+org.eclipse.jdt.core.compiler.problem.nullAnnotationInferenceConflict=warning
+org.eclipse.jdt.core.compiler.problem.nullReference=warning
org.eclipse.jdt.core.compiler.problem.nullSpecInsufficientInfo=warning
-org.eclipse.jdt.core.compiler.problem.nullSpecViolation=error
+org.eclipse.jdt.core.compiler.problem.nullSpecViolation=warning
org.eclipse.jdt.core.compiler.problem.nullUncheckedConversion=ignore
org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning
org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore
diff --git a/sdkstats/sdkstats.iml b/sdkstats/sdkstats.iml
new file mode 100644
index 0000000..98052ab
--- /dev/null
+++ b/sdkstats/sdkstats.iml
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<module type="JAVA_MODULE" version="4">
+ <component name="NewModuleRootManager" inherit-compiler-output="true">
+ <exclude-output />
+ <content url="file://$MODULE_DIR$">
+ <sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
+ <sourceFolder url="file://$MODULE_DIR$/src/test/java" isTestSource="true" />
+ </content>
+ <orderEntry type="inheritedJdk" />
+ <orderEntry type="sourceFolder" forTests="false" />
+ <orderEntry type="library" name="org-eclipse-core-commands-3.6.0" level="project" />
+ <orderEntry type="library" name="org-eclipse-equinox-common-3.6.0" level="project" />
+ <orderEntry type="library" name="org-eclipse-jface-3.6.2" level="project" />
+ <orderEntry type="library" name="swt" level="project" />
+ <orderEntry type="module" module-name="common" />
+ <orderEntry type="library" scope="TEST" name="JUnit3" level="project" />
+ </component>
+</module>
+
diff --git a/swtmenubar/.settings/README.txt b/swtmenubar/.settings/README.txt
new file mode 100644
index 0000000..9120b20
--- /dev/null
+++ b/swtmenubar/.settings/README.txt
@@ -0,0 +1,2 @@
+Copy this in eclipse project as a .settings folder at the root.
+This ensure proper compilation compliance and warning/error levels.
\ No newline at end of file
diff --git a/ddms/ddmuilib/.settings/org.eclipse.jdt.core.prefs b/swtmenubar/.settings/org.eclipse.jdt.core.prefs
similarity index 97%
copy from ddms/ddmuilib/.settings/org.eclipse.jdt.core.prefs
copy to swtmenubar/.settings/org.eclipse.jdt.core.prefs
index 9dbff07..ea66196 100644
--- a/ddms/ddmuilib/.settings/org.eclipse.jdt.core.prefs
+++ b/swtmenubar/.settings/org.eclipse.jdt.core.prefs
@@ -48,10 +48,10 @@ org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=ignor
org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning
org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning
org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore
-org.eclipse.jdt.core.compiler.problem.nullAnnotationInferenceConflict=error
-org.eclipse.jdt.core.compiler.problem.nullReference=error
+org.eclipse.jdt.core.compiler.problem.nullAnnotationInferenceConflict=warning
+org.eclipse.jdt.core.compiler.problem.nullReference=warning
org.eclipse.jdt.core.compiler.problem.nullSpecInsufficientInfo=warning
-org.eclipse.jdt.core.compiler.problem.nullSpecViolation=error
+org.eclipse.jdt.core.compiler.problem.nullSpecViolation=warning
org.eclipse.jdt.core.compiler.problem.nullUncheckedConversion=ignore
org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning
org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore
diff --git a/swtmenubar/swtmenubar.iml b/swtmenubar/swtmenubar.iml
new file mode 100644
index 0000000..b30a4e6
--- /dev/null
+++ b/swtmenubar/swtmenubar.iml
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<module type="JAVA_MODULE" version="4">
+ <component name="NewModuleRootManager" inherit-compiler-output="true">
+ <exclude-output />
+ <content url="file://$MODULE_DIR$">
+ <sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
+ <sourceFolder url="file://$MODULE_DIR$/src/main-darwin/java" isTestSource="false" />
+ </content>
+ <orderEntry type="inheritedJdk" />
+ <orderEntry type="sourceFolder" forTests="false" />
+ <orderEntry type="library" name="org-eclipse-core-commands-3.6.0" level="project" />
+ <orderEntry type="library" name="org-eclipse-equinox-common-3.6.0" level="project" />
+ <orderEntry type="library" name="org-eclipse-jface-3.6.2" level="project" />
+ <orderEntry type="library" name="swt" level="project" />
+ </component>
+</module>
+
diff --git a/traceview/.classpath b/traceview/.classpath
index b6b7f30..99ca0d8 100644
--- a/traceview/.classpath
+++ b/traceview/.classpath
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry excluding="resources/" kind="src" path="src/main/java"/>
- <classpathentry kind="src" path="src/main/java/resources"/>
+ <classpathentry kind="src" path="src/main/resources"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry combineaccessrules="false" exported="true" kind="src" path="/common"/>
<classpathentry exported="true" kind="var" path="ANDROID_OUT_FRAMEWORK/swt.jar"/>
diff --git a/traceview/.settings/org.eclipse.jdt.core.prefs b/traceview/.settings/org.eclipse.jdt.core.prefs
index 9dbff07..ea66196 100644
--- a/traceview/.settings/org.eclipse.jdt.core.prefs
+++ b/traceview/.settings/org.eclipse.jdt.core.prefs
@@ -48,10 +48,10 @@ org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=ignor
org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning
org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning
org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore
-org.eclipse.jdt.core.compiler.problem.nullAnnotationInferenceConflict=error
-org.eclipse.jdt.core.compiler.problem.nullReference=error
+org.eclipse.jdt.core.compiler.problem.nullAnnotationInferenceConflict=warning
+org.eclipse.jdt.core.compiler.problem.nullReference=warning
org.eclipse.jdt.core.compiler.problem.nullSpecInsufficientInfo=warning
-org.eclipse.jdt.core.compiler.problem.nullSpecViolation=error
+org.eclipse.jdt.core.compiler.problem.nullSpecViolation=warning
org.eclipse.jdt.core.compiler.problem.nullUncheckedConversion=ignore
org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning
org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore
diff --git a/traceview/etc/traceview.bat b/traceview/etc/traceview.bat
index 63416dd..8b71731 100755
--- a/traceview/etc/traceview.bat
+++ b/traceview/etc/traceview.bat
@@ -30,17 +30,17 @@ call lib\find_java.bat
if not defined java_exe goto :EOF
set jarfile=traceview.jar
-set frameworkdir=
+set frameworkdir=.
-if exist %frameworkdir%%jarfile% goto JarFileOk
- set frameworkdir=lib\
+if exist %frameworkdir%\%jarfile% goto JarFileOk
+ set frameworkdir=lib
-if exist %frameworkdir%%jarfile% goto JarFileOk
- set frameworkdir=..\framework\
+if exist %frameworkdir%\%jarfile% goto JarFileOk
+ set frameworkdir=..\framework
:JarFileOk
-set jarpath=%frameworkdir%%jarfile%
+set jarpath=%frameworkdir%\%jarfile%
if not defined ANDROID_SWT goto QueryArch
set swt_path=%ANDROID_SWT%
@@ -48,11 +48,11 @@ if not defined ANDROID_SWT goto QueryArch
:QueryArch
- for /f %%a in ('%java_exe% -jar %frameworkdir%archquery.jar') do set swt_path=%frameworkdir%%%a
+ for /f "delims=" %%a in ('"%java_exe%" -jar %frameworkdir%\archquery.jar') do set swt_path=%frameworkdir%\%%a
:SwtDone
-if exist %swt_path% goto SetPath
+if exist "%swt_path%" goto SetPath
echo SWT folder '%swt_path%' does not exist.
echo Please set ANDROID_SWT to point to the folder containing swt.jar for your platform.
exit /B
@@ -62,4 +62,4 @@ set javaextdirs=%swt_path%;%frameworkdir%
echo The standalone version of traceview is deprecated.
echo Please use Android Device Monitor (tools/monitor) instead.
-call %java_exe% -Djava.ext.dirs=%javaextdirs% -Dcom.android.traceview.toolsdir= -jar %jarpath% %*
+call "%java_exe%" "-Djava.ext.dirs=%javaextdirs%" -Dcom.android.traceview.toolsdir= -jar %jarpath% %*
diff --git a/traceview/traceview.iml b/traceview/traceview.iml
new file mode 100644
index 0000000..1da938e
--- /dev/null
+++ b/traceview/traceview.iml
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<module type="JAVA_MODULE" version="4">
+ <component name="NewModuleRootManager" inherit-compiler-output="true">
+ <exclude-output />
+ <content url="file://$MODULE_DIR$">
+ <sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
+ <sourceFolder url="file://$MODULE_DIR$/src/main/resources" isTestSource="false" />
+ </content>
+ <orderEntry type="inheritedJdk" />
+ <orderEntry type="sourceFolder" forTests="false" />
+ <orderEntry type="library" name="swt" level="project" />
+ <orderEntry type="module" module-name="sdkstats" />
+ <orderEntry type="library" name="org-eclipse-core-commands-3.6.0" level="project" />
+ <orderEntry type="library" name="org-eclipse-equinox-common-3.6.0" level="project" />
+ <orderEntry type="library" name="org-eclipse-jface-3.6.2" level="project" />
+ <orderEntry type="module" module-name="common" />
+ </component>
+</module>
+
diff --git a/uiautomatorviewer/.settings/org.eclipse.jdt.core.prefs b/uiautomatorviewer/.settings/org.eclipse.jdt.core.prefs
index 9dbff07..ea66196 100644
--- a/uiautomatorviewer/.settings/org.eclipse.jdt.core.prefs
+++ b/uiautomatorviewer/.settings/org.eclipse.jdt.core.prefs
@@ -48,10 +48,10 @@ org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=ignor
org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning
org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning
org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore
-org.eclipse.jdt.core.compiler.problem.nullAnnotationInferenceConflict=error
-org.eclipse.jdt.core.compiler.problem.nullReference=error
+org.eclipse.jdt.core.compiler.problem.nullAnnotationInferenceConflict=warning
+org.eclipse.jdt.core.compiler.problem.nullReference=warning
org.eclipse.jdt.core.compiler.problem.nullSpecInsufficientInfo=warning
-org.eclipse.jdt.core.compiler.problem.nullSpecViolation=error
+org.eclipse.jdt.core.compiler.problem.nullSpecViolation=warning
org.eclipse.jdt.core.compiler.problem.nullUncheckedConversion=ignore
org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning
org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore
diff --git a/uiautomatorviewer/etc/uiautomatorviewer.bat b/uiautomatorviewer/etc/uiautomatorviewer.bat
index f3f5d47..d3bdbd8 100755
--- a/uiautomatorviewer/etc/uiautomatorviewer.bat
+++ b/uiautomatorviewer/etc/uiautomatorviewer.bat
@@ -33,17 +33,17 @@ call lib\find_java.bat
if not defined java_exe goto :EOF
set jarfile=uiautomatorviewer.jar
-set frameworkdir=
+set frameworkdir=.
-if exist %frameworkdir%%jarfile% goto JarFileOk
- set frameworkdir=lib\
+if exist %frameworkdir%\%jarfile% goto JarFileOk
+ set frameworkdir=lib
-if exist %frameworkdir%%jarfile% goto JarFileOk
- set frameworkdir=..\framework\
+if exist %frameworkdir%\%jarfile% goto JarFileOk
+ set frameworkdir=..\framework
:JarFileOk
-set jarpath=%frameworkdir%%jarfile%
+set jarpath=%frameworkdir%\%jarfile%
if not defined ANDROID_SWT goto QueryArch
set swt_path=%ANDROID_SWT%
@@ -51,11 +51,11 @@ if not defined ANDROID_SWT goto QueryArch
:QueryArch
- for /f %%a in ('%java_exe% -jar %frameworkdir%archquery.jar') do set swt_path=%frameworkdir%%%a
+ for /f "delims=" %%a in ('"%java_exe%" -jar %frameworkdir%\archquery.jar') do set swt_path=%frameworkdir%\%%a
:SwtDone
-if exist %swt_path% goto SetPath
+if exist "%swt_path%" goto SetPath
echo SWT folder '%swt_path%' does not exist.
echo Please set ANDROID_SWT to point to the folder containing swt.jar for your platform.
exit /B
@@ -63,4 +63,4 @@ if exist %swt_path% goto SetPath
:SetPath
set javaextdirs=%swt_path%;%frameworkdir%
-call %java_exe% -Djava.ext.dirs=%javaextdirs% -Dcom.android.uiautomator.bindir=%prog_dir% -jar %jarpath% %*
+call "%java_exe%" "-Djava.ext.dirs=%javaextdirs%" "-Dcom.android.uiautomator.bindir=%prog_dir%" -jar %jarpath% %*
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-java/androidsdk-tools.git
More information about the pkg-java-commits
mailing list